app_permit_controller.go 578 B

123456789101112131415161718192021222324252627
  1. package controllers
  2. import (
  3. "github.com/kataras/iris/v12/mvc"
  4. "xps/service/system"
  5. )
  6. type AppPermitController struct {
  7. Base
  8. Service system.AppPermitService
  9. }
  10. func (c *AppPermitController) BeforeActivation(b mvc.BeforeActivation) {
  11. b.Handle("GET", "/", "GetByList")
  12. }
  13. func (c *AppPermitController) GetByList() *JsonResult {
  14. var appKey = c.Ctx.Values().GetString("appKey")
  15. var keywords string
  16. if c.Ctx.URLParamExists("keywords") {
  17. keywords = c.Ctx.URLParam("keywords")
  18. }
  19. data := c.Service.GetByList(appKey, 1, keywords)
  20. return ResultOk("获取成功", data)
  21. }