district_api_controller.go 487B

1234567891011121314151617181920212223242526
  1. package controllers
  2. import (
  3. "XT_New/service"
  4. "github.com/astaxie/beego"
  5. )
  6. type DistrictApiController struct {
  7. BaseAuthAPIController
  8. }
  9. func DistrictApiRegistRouters() {
  10. beego.Router("/api/district/getdistrictsbyupid", &DistrictApiController{}, "get:GetDistrictsByUpid")
  11. }
  12. func (c *DistrictApiController) GetDistrictsByUpid() {
  13. id, _ := c.GetInt64("id", 0)
  14. citys, _ := service.GetDistrictsByUpid(id)
  15. c.ServeSuccessJSON(map[string]interface{}{
  16. "citys": citys,
  17. })
  18. return
  19. }