package global import ( base_ctl "SCRM/controllers" "SCRM/service/district_service" "github.com/astaxie/beego" ) type DistrictApiController struct { base_ctl.BaseAPIController } func DistrictCtlRegistRouters() { beego.Router("/api/district/getdistrictsbyupid", &DistrictApiController{}, "get:GetDistrictsByUpid") } func (c *DistrictApiController) GetDistrictsByUpid() { id, _ := c.GetInt64("id", 0) citys, _ := district_service.GetDistrictsByUpid(id) c.ServeSuccessJSON(map[string]interface{}{ "citys": citys, }) return }