123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- package api
- import (
- "box-cost/db/model"
- "box-cost/db/repo"
- "box-cost/log"
- "errors"
- "fmt"
- "time"
- "github.com/gin-gonic/gin"
- )
- func DiffUpdatePlanTest(c *gin.Context, apictx *ApiSession) (interface{}, error) {
- var plan model.ProductPlan
- err := c.ShouldBindJSON(&plan)
- if err != nil {
- fmt.Println(err)
- log.Error(err)
- return nil, errors.New("参数错误")
- }
- if plan.Id.Hex() == "" {
- return nil, errors.New("id的为空")
- }
- plan.UpdateTime = time.Now()
-
-
-
-
-
-
-
-
-
- result, err1 := repo.RepoUpdateSetDoc1(apictx.CreateRepoCtx(), "product-plan_copy1", plan.Id.Hex(), &plan, &repo.RecordLogReq{
- Path: c.Request.URL.Path,
- TargetId: plan.Id.Hex(),
- })
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- return result, err1
- }
- func DiffUpdateProduceTest(c *gin.Context, apictx *ApiSession) (interface{}, error) {
- var produce model.ProduceBill
- err := c.ShouldBindJSON(&produce)
- if err != nil {
- fmt.Println(err)
- log.Error(err)
- return nil, errors.New("参数错误")
- }
- if produce.Id.Hex() == "" {
- return nil, errors.New("id的为空")
- }
- produce.UpdateTime = time.Now()
- result, err1 := repo.RepoUpdateSetDoc1(apictx.CreateRepoCtx(), "bill-produce_copy1", produce.Id.Hex(), &produce, &repo.RecordLogReq{
- Path: c.Request.URL.Path,
- TargetId: produce.Id.Hex(),
- })
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- return result, err1
- }
|