|
@@ -0,0 +1,27 @@
|
|
|
+package pdd
|
|
|
+
|
|
|
+import (
|
|
|
+ "duoduo/models/pdd"
|
|
|
+ "duoduo/tools/app"
|
|
|
+ "github.com/gin-gonic/gin"
|
|
|
+)
|
|
|
+
|
|
|
+func Set(c *gin.Context) {
|
|
|
+
|
|
|
+ var inData pdd.SetRequest
|
|
|
+ var outData pdd.SetResponse
|
|
|
+ err := c.ShouldBindJSON(&inData)
|
|
|
+ if err != nil {
|
|
|
+ app.Error(c, 400, err, err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ if inData.Version == "1.0.0" {
|
|
|
+ outData.Type = "true"
|
|
|
+ app.OK(c, outData, app.Success)
|
|
|
+ } else {
|
|
|
+ outData.Type = "false"
|
|
|
+ app.OK(c, outData, app.Success)
|
|
|
+ }
|
|
|
+
|
|
|
+}
|