You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
824 B
36 lines
824 B
package setting
|
|
|
|
import (
|
|
"base/app/common"
|
|
"base/app/lib/bean"
|
|
"base/app/logic/manage/setting"
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
type Parameter struct {
|
|
}
|
|
|
|
// All @Title 全部参数
|
|
func (p *Parameter) All(c *gin.Context) {
|
|
bean.Response.ResultSuc(c, "操作成功", setting.SystemLogic.GetSystem())
|
|
}
|
|
|
|
type CarPriceRateEdit struct {
|
|
Rate decimal.Decimal `binding:"required" label:"估值系数"`
|
|
}
|
|
|
|
// Edit @Title 编辑
|
|
func (p *Parameter) Edit(c *gin.Context) {
|
|
args := CarPriceRateEdit{}
|
|
if err := c.ShouldBind(&args); err != nil {
|
|
bean.Response.ResultFail(c, 10001, common.GetVerErr(err))
|
|
return
|
|
}
|
|
if err := setting.ParameterLogic.Edit(args.Rate); err != nil {
|
|
bean.Response.ResultFail(c, 10002, err.Error())
|
|
return
|
|
}
|
|
bean.Response.ResultSuc(c, "操作成功", nil)
|
|
}
|