testGet.go 694 B

1234567891011121314151617181920212223242526272829303132
  1. package service
  2. import (
  3. "github.com/gin-gonic/gin"
  4. models "base-gin/model"
  5. )
  6. type resTest struct {
  7. WarehouseCode string `form:"warehouseCode"`
  8. BoxCode string `form:"boxCode"`
  9. StartID string `form:"startID"`
  10. PageSize int `form:"pageSize"`
  11. IsCurrent int `form:"isCurrent"`
  12. }
  13. func TestGet(c *gin.Context) (res *resTest, err error) {
  14. res = &resTest{
  15. WarehouseCode: "11",
  16. BoxCode: "box01",
  17. StartID: "start111",
  18. PageSize: 50,
  19. IsCurrent: 1,
  20. }
  21. return res, nil
  22. }
  23. func GetConfig(c *gin.Context, key string) (res string, err error) {
  24. res, err = models.GetConfigValue(c, key)
  25. if err != nil {
  26. return "", err
  27. }
  28. return res, nil
  29. }