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.4" {
		outData.Type = "true"
		app.OK(c, outData, app.Success)
	} else if inData.Version == "2.1.1"{
		outData.Type = "true"
		app.OK(c, outData, app.Success)
	} else {
		outData.Type = "false"
		app.OK(c, outData, app.Success)
	}

}