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