set.go 542 B

123456789101112131415161718192021222324252627282930
  1. package pdd
  2. import (
  3. "duoduo/models/pdd"
  4. "duoduo/tools/app"
  5. "github.com/gin-gonic/gin"
  6. )
  7. func Set(c *gin.Context) {
  8. var inData pdd.SetRequest
  9. var outData pdd.SetResponse
  10. err := c.ShouldBindJSON(&inData)
  11. if err != nil {
  12. app.Error(c, 400, err, err.Error())
  13. return
  14. }
  15. if inData.Version == "1.0.6" {
  16. outData.Type = "true"
  17. app.OK(c, outData, app.Success)
  18. } else if inData.Version == "2.1.1" {
  19. outData.Type = "true"
  20. app.OK(c, outData, app.Success)
  21. } else {
  22. outData.Type = "false"
  23. app.OK(c, outData, app.Success)
  24. }
  25. }