Explorar el Código

feature:添加 swagger

liuyaqi hace 3 años
padre
commit
0e4b2fbeb6

+ 33 - 0
opms_parent/app/handler/contract/ctr_contract.go

@@ -12,6 +12,23 @@ import (
 
 type CtrContract struct{}
 
+func (c *CtrContract) Get(ctx context.Context, req *model.IdRequiredReq, rsp *comm_def.CommonMsg) error {
+	g.Log().Infof("CtrContract.Get request %#v ", *req)
+	s, err := service.NewCtrContractService(ctx)
+	if err != nil {
+		return err
+	}
+	ent, err := s.Get(ctx, req.Id)
+	_, err, code, msg := myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	rsp.Code = code
+	rsp.Msg = msg
+	rsp.Data = ent
+	return nil
+}
+
 func (c *CtrContract) List(ctx context.Context, req *model.CtrContractListReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContract.List request %#v ", *req)
 	s, err := service.NewCtrContractService(ctx)
@@ -68,6 +85,22 @@ func (c *CtrContract) Update(ctx context.Context, req *model.CtrContractUpdateRe
 	return nil
 }
 
+func (c *CtrContract) Transfer(ctx context.Context, req *model.CtrContractTransferReq, rsp *comm_def.CommonMsg) error {
+	g.Log().Infof("CtrContract.Transfer request %#v ", *req)
+	s, err := service.NewCtrContractService(ctx)
+	if err != nil {
+		return err
+	}
+	err = s.Transfer(ctx, req)
+	_, err, code, msg := myerrors.CheckError(err)
+	if err != nil {
+		return err
+	}
+	rsp.Code = code
+	rsp.Msg = msg
+	return nil
+}
+
 func (c *CtrContract) Delete(ctx context.Context, req *model.IdsReq, rsp *comm_def.CommonMsg) error {
 	g.Log().Infof("CtrContract.Delete request %#v ", *req)
 	s, err := service.NewCtrContractService(ctx)

+ 0 - 0
opms_parent/app/handler/contract/ctr_contract_invoice.go → opms_parent/app/handler/contract/ctr_contract_invoice.go.bak


+ 30 - 19
opms_parent/app/model/contract/ctr_contract.go

@@ -14,25 +14,30 @@ import (
 type CtrContract internal.CtrContract
 
 // Fill with you ideas below.
+type CtrContractGetRsp struct {
+	CtrContract
+	Product []*CtrContractProduct `json:"product"` // 产品
+}
+
 type CtrContractListReq struct {
 	request.PageReq
-	SearchText        string      `json:"searchText"`        // 合同编号,合同名称,客户名称,项目名称
-	ContractCode      string      `json:"contractCode"`      // 合同编号
-	ContractName      string      `json:"contractName"`      // 合同名称
-	CustId            int         `json:"custId"`            // 关联客户
-	CustName          string      `json:"custName"`          // 客户名称
-	NboId             int         `json:"nboId"`             // 关联项目
-	NboName           string      `json:"nboName"`           // 项目名称
-	ApproStatus       string      `json:"approStatus"`       // 审批状态
-	ContractType      string      `json:"contractType"`      // 合同类型
-	ContractStartTime *gtime.Time `json:"contractStartTime"` // 合同开始时间
-	ContractEndTime   *gtime.Time `json:"contractEndTime"`   // 合同结束时间
-	InchargeId        int         `json:"inchargeId"`        // 负责人ID
-	InchargeName      string      `json:"inchargeName"`      // 负责人
-	SignatoryId       int         `json:"signatoryId"`       // 公司签约人ID
-	SignatoryName     string      `json:"signatoryName"`     // 公司签约人
-	DistributorId     int         `json:"distributorId"`     // 经销商ID
-	DistributorName   string      `json:"distributorName"`   // 经销商
+	SearchText   string `json:"searchText"`   // 合同编号,合同名称,客户名称,项目名称
+	ContractCode string `json:"contractCode"` // 合同编号
+	ContractName string `json:"contractName"` // 合同名称
+	CustId       int    `json:"custId"`       // 关联客户
+	CustName     string `json:"custName"`     // 客户名称
+	NboId        int    `json:"nboId"`        // 关联项目
+	NboName      string `json:"nboName"`      // 项目名称
+	ApproStatus  string `json:"approStatus"`  // 审批状态
+	ContractType string `json:"contractType"` // 合同类型
+	// ContractStartTime *gtime.Time `json:"contractStartTime"` // 合同开始时间
+	// ContractEndTime   *gtime.Time `json:"contractEndTime"`   // 合同结束时间
+	InchargeId      int    `json:"inchargeId"`      // 负责人ID
+	InchargeName    string `json:"inchargeName"`    // 负责人
+	SignatoryId     int    `json:"signatoryId"`     // 公司签约人ID
+	SignatoryName   string `json:"signatoryName"`   // 公司签约人
+	DistributorId   int    `json:"distributorId"`   // 经销商ID
+	DistributorName string `json:"distributorName"` // 经销商
 }
 
 type CtrAddProduct struct {
@@ -56,7 +61,7 @@ type CtrContractAddReq struct {
 	// CustName          string      `json:"custName"`          // 客户名称
 	NboId int `json:"nboId"` // 关联项目
 	// NboName           string      `json:"nboName"`           // 项目名称
-	ApproStatus  string `json:"approStatus"`  // 审批状态
+	// ApproStatus  string `json:"approStatus"`  // 审批状态
 	ContractType string `json:"contractType"` // 合同类型
 	// ContractAmount    float64         `json:"contractAmount"`    // 合同金额
 	// InvoiceAmount     float64         `json:"invoiceAmount"`     // 已开票金额
@@ -81,7 +86,7 @@ type CtrContractUpdateReq struct {
 	// CustName          string      `json:"custName"`          // 客户名称
 	NboId int `json:"nboId"` // 关联项目
 	// NboName           string      `json:"nboName"`           // 项目名称
-	ApproStatus  string `json:"approStatus"`  // 审批状态
+	// ApproStatus  string `json:"approStatus"`  // 审批状态
 	ContractType string `json:"contractType"` // 合同类型
 	// ContractAmount    float64          `json:"contractAmount"`    // 合同金额
 	// InvoiceAmount     float64          `json:"invoiceAmount"`     // 已开票金额
@@ -97,3 +102,9 @@ type CtrContractUpdateReq struct {
 	Remark            *string          `json:"remark"`
 	Product           *[]CtrAddProduct `json:"product"` // 产品
 }
+
+type CtrContractTransferReq struct {
+	Id           int    `json:"id" v:"required#请输入Id"`
+	InchargeId   int    `json:"inchargeId"`   // 负责人ID
+	InchargeName string `json:"inchargeName"` // 负责人
+}

+ 57 - 10
opms_parent/app/service/contract/ctr_contract.go

@@ -55,6 +55,27 @@ func NewCtrContractService(ctx context.Context) (*CtrContractService, error) {
 	}, nil
 }
 
+func (s CtrContractService) Get(ctx context.Context, id int) (*model.CtrContractGetRsp, error) {
+	ent, err := s.Dao.Where("Id = ?", id).One()
+	if err != nil {
+		return nil, err
+	}
+	if ent == nil {
+		return nil, myerrors.NewMsgError(nil, "合同不存在")
+	}
+	product, err := s.CtrProductDao.Where("contract_id = ?", id).All()
+	if err != nil {
+		return nil, err
+	}
+	if product == nil {
+		product = []*model.CtrContractProduct{}
+	}
+	return &model.CtrContractGetRsp{
+		CtrContract: *ent,
+		Product:     product,
+	}, nil
+}
+
 func (s CtrContractService) List(ctx context.Context, req *model.CtrContractListReq) (int, []*model.CtrContract, error) {
 	dao := &s.Dao.CtrContractDao
 	if req.SearchText != "" {
@@ -89,12 +110,12 @@ func (s CtrContractService) List(ctx context.Context, req *model.CtrContractList
 	if req.ContractType != "" {
 		dao = dao.Where("contract_type = ?", req.ContractType)
 	}
-	if req.ContractStartTime != nil {
-		dao = dao.Where("contract_start_time > ?", req.ContractStartTime)
-	}
-	if req.ContractEndTime != nil {
-		dao = dao.Where("contract_end_time < ?", req.ContractEndTime)
-	}
+	// if req.ContractStartTime != nil {
+	// 	dao = dao.Where("contract_start_time > ?", req.ContractStartTime)
+	// }
+	// if req.ContractEndTime != nil {
+	// 	dao = dao.Where("contract_end_time < ?", req.ContractEndTime)
+	// }
 	if req.InchargeId != 0 {
 		dao = dao.Where("incharge_id = ?", req.InchargeId)
 	}
@@ -233,7 +254,7 @@ func (s CtrContractService) Add(ctx context.Context, req *model.CtrContractAddRe
 		CustName:          nbo.CustName,
 		NboId:             nbo.Id,
 		NboName:           nbo.NboName,
-		ApproStatus:       req.ApproStatus,
+		ApproStatus:       "",
 		ContractType:      req.ContractType,
 		ContractAmount:    contractAmount,
 		InvoiceAmount:     0,
@@ -329,9 +350,9 @@ func (s CtrContractService) Update(ctx context.Context, req *model.CtrContractUp
 		toupdate["nbo_id"] = nbo.Id
 		toupdate["nbo_name"] = nbo.NboName
 	}
-	if req.ApproStatus != "" {
-		toupdate["appro_status"] = req.ApproStatus
-	}
+	// if req.ApproStatus != "" {
+	// 	toupdate["appro_status"] = req.ApproStatus
+	// }
 	if req.ContractType != "" {
 		toupdate["contract_type"] = req.ContractType
 	}
@@ -397,8 +418,34 @@ func (s CtrContractService) Update(ctx context.Context, req *model.CtrContractUp
 			return nil
 		})
 		if txerr != nil {
+			return txerr
+		}
+	}
+	return nil
+}
+
+func (s CtrContractService) Transfer(ctx context.Context, req *model.CtrContractTransferReq) error {
+	ent, err := s.Dao.Where("id = ?", req.Id).One()
+	if err != nil {
+		return err
+	}
+	if ent == nil {
+		return myerrors.NewMsgError(nil, fmt.Sprintf("合同不存在: %d", req.Id))
+	}
+
+	txerr := s.Dao.DB.Transaction(ctx, func(ctx context.Context, tx *gdb.TX) error {
+		toupdate := map[string]interface{}{
+			"incharge_id":   req.InchargeId,
+			"incharge_name": req.InchargeName,
+		}
+		_, err := tx.Update("ctr_contract", toupdate, "id = ?", req.Id)
+		if err != nil {
 			return err
 		}
+		return nil
+	})
+	if txerr != nil {
+		return txerr
 	}
 	return nil
 }

+ 0 - 0
opms_parent/app/service/contract/ctr_contract_invoice.go → opms_parent/app/service/contract/ctr_contract_invoice.go.bak


+ 16 - 0
opms_parent/main.go

@@ -2,18 +2,23 @@ package main
 
 import (
 	"context"
+	"net/http"
 
 	"dashoo.cn/opms_libary/micro_srv"
 	"github.com/gogf/gf/frame/g"
+	"github.com/gogf/gf/os/glog"
 	"github.com/smallnest/rpcx/protocol"
 
 	"dashoo.cn/micro/app/handler/base"
+	"dashoo.cn/micro/app/handler/contract"
 	"dashoo.cn/micro/app/handler/cust"
 	"dashoo.cn/micro/app/handler/plat"
 	projHandler "dashoo.cn/micro/app/handler/proj"
 )
 
 func main() {
+	go swaggerui()
+
 	srvAddr := g.Config().GetString("setting.bind-addr")
 	basePath := g.Config().GetString("setting.srv-name")
 	// 创建总服务包
@@ -38,6 +43,7 @@ func main() {
 	s.RegisterName("BusinessDynamics", new(projHandler.BusinessDynamicsHandler), "")
 	s.RegisterName("BusinessFile", new(projHandler.BusinessFileHandler), "")
 	s.RegisterName("BusinessTeam", new(projHandler.BusinessTeamHandler), "")
+	s.RegisterName("CtrContract", new(contract.CtrContract), "")
 
 	// 注册服务对象
 	//s.RegisterName("Auth", new(handler.Auth), "")
@@ -68,3 +74,13 @@ func handleAuth(ctx context.Context, req *protocol.Message, token string) error
 	return micro_srv.HandleAuth(ctx, req, token, AuthExcludePaths)
 
 }
+
+func swaggerui() {
+	defer func() {
+		if r := recover(); r != nil {
+			glog.Error(r)
+		}
+	}()
+	glog.Error(http.ListenAndServe(":8080",
+		http.FileServer(http.Dir("./swaggerui/"))))
+}

BIN
opms_parent/swaggerui/favicon-16x16.png


BIN
opms_parent/swaggerui/favicon-32x32.png


+ 92 - 0
opms_parent/swaggerui/index.html

@@ -0,0 +1,92 @@
+<!-- HTML for static distribution bundle build -->
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8">
+    <title>Swagger UI</title>
+    <link rel="stylesheet" type="text/css" href="swagger-ui.css" >
+    <link rel="icon" type="image/png" href="favicon-32x32.png" sizes="32x32" />
+    <link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16" />
+    <style>
+      html
+      {
+        box-sizing: border-box;
+        overflow: -moz-scrollbars-vertical;
+        overflow-y: scroll;
+      }
+
+      *,
+      *:before,
+      *:after
+      {
+        box-sizing: inherit;
+      }
+
+      body
+      {
+        margin:0;
+        background: #fafafa;
+      }
+    </style>
+  </head>
+
+  <body>
+    <div id="swagger-ui"></div>
+
+    <script src="swagger-ui-bundle.js"> </script>
+    <script src="swagger-ui-standalone-preset.js"> </script>
+    <script>
+    window.onload = function() {
+      // Begin Swagger UI call region
+      const ui = SwaggerUIBundle({
+        url: "./swagger.yml",
+        dom_id: '#swagger-ui',
+        deepLinking: true,
+        presets: [
+          SwaggerUIBundle.presets.apis,
+          SwaggerUIStandalonePreset
+        ],
+        plugins: [
+          SwaggerUIBundle.plugins.DownloadUrl
+        ],
+        layout: "StandaloneLayout",
+        // 设置 token
+        requestInterceptor: (req) => {
+          if (req.url == "./swagger.yml") {
+            return
+          }
+          console.log(req)
+          // let serviceUrl = "http://192.168.0.105:9981/dashoo.dev.lims.micro_learning-1.0"
+          let serviceUrl = "http://192.168.0.252:8100/dashoo.dev.opms.parent-0.0.1"
+          let reqUrl = new URL(req.url)
+          let urlInfo = reqUrl.pathname.substring(1).split('.')
+          if (urlInfo.length < 2) {
+            return
+          }
+          let servicePath = urlInfo[0]
+          let serviceMethod = urlInfo[1]
+          let token = req.headers.Authorization
+          if (!token) {
+            // token = "Bearer ajg7o1Dts1JrKCm6VtgyuuaYbUIiirXxI5+6WzYnC7gWl+43NdKq6LbWxU1zWhsBaL0A/CIkBoefM0vuu6h4ZA=="
+            token = "Bearer XHPbgFL1HqGOuYvMihA4oPtWy0wLKFF3i20ah/rev5/3QeP7ztdVCmO3x0LljVl1"
+            // token = "Bearer EyQWHd05nop+PL71oABt/1i0zoXd7bym1bFMWMXorORLmyDuyowEDoiKq8DhP2lbZo9XTSMe31d0Q7RRnkDNLA=="
+            // token = "Bearer 7XrzVhU+ibTV/77q7h0ETY+bEWy4r4g9wteUr/43vNadbuWG5y8wucSmeU0BRd/1"
+          }
+
+          req.url = serviceUrl
+          req.headers["X-RPCX-SerializeType"] = "1"
+          req.headers["X-RPCX-ServicePath"] = servicePath
+          req.headers["X-RPCX-ServiceMethod"] = serviceMethod
+          req.headers["Tenant"] = "default"
+          req.headers["Authorization"] = token
+          req.headers["SrvEnv"] = "dev"
+          return req
+        }
+      })
+      // End Swagger UI call region
+
+      window.ui = ui
+    }
+  </script>
+  </body>
+</html>

+ 68 - 0
opms_parent/swaggerui/oauth2-redirect.html

@@ -0,0 +1,68 @@
+<!doctype html>
+<html lang="en-US">
+<title>Swagger UI: OAuth2 Redirect</title>
+<body onload="run()">
+</body>
+</html>
+<script>
+    'use strict';
+    function run () {
+        var oauth2 = window.opener.swaggerUIRedirectOauth2;
+        var sentState = oauth2.state;
+        var redirectUrl = oauth2.redirectUrl;
+        var isValid, qp, arr;
+
+        if (/code|token|error/.test(window.location.hash)) {
+            qp = window.location.hash.substring(1);
+        } else {
+            qp = location.search.substring(1);
+        }
+
+        arr = qp.split("&")
+        arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';})
+        qp = qp ? JSON.parse('{' + arr.join() + '}',
+                function (key, value) {
+                    return key === "" ? value : decodeURIComponent(value)
+                }
+        ) : {}
+
+        isValid = qp.state === sentState
+
+        if ((
+          oauth2.auth.schema.get("flow") === "accessCode"||
+          oauth2.auth.schema.get("flow") === "authorizationCode"
+        ) && !oauth2.auth.code) {
+            if (!isValid) {
+                oauth2.errCb({
+                    authId: oauth2.auth.name,
+                    source: "auth",
+                    level: "warning",
+                    message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
+                });
+            }
+
+            if (qp.code) {
+                delete oauth2.state;
+                oauth2.auth.code = qp.code;
+                oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
+            } else {
+                let oauthErrorMsg
+                if (qp.error) {
+                    oauthErrorMsg = "["+qp.error+"]: " +
+                        (qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
+                        (qp.error_uri ? "More info: "+qp.error_uri : "");
+                }
+
+                oauth2.errCb({
+                    authId: oauth2.auth.name,
+                    source: "auth",
+                    level: "error",
+                    message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
+                });
+            }
+        } else {
+            oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
+        }
+        window.close();
+    }
+</script>

+ 11 - 0
opms_parent/swaggerui/server.go

@@ -0,0 +1,11 @@
+package main
+
+import (
+	"log"
+	"net/http"
+)
+
+func main() {
+	log.Fatal(http.ListenAndServe(":8080",
+		http.FileServer(http.Dir("./swaggerui/"))))
+}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
opms_parent/swaggerui/swagger-ui-bundle.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
opms_parent/swaggerui/swagger-ui-bundle.js.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
opms_parent/swaggerui/swagger-ui-standalone-preset.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
opms_parent/swaggerui/swagger-ui-standalone-preset.js.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 0
opms_parent/swaggerui/swagger-ui.css


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
opms_parent/swaggerui/swagger-ui.css.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
opms_parent/swaggerui/swagger-ui.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
opms_parent/swaggerui/swagger-ui.js.map


+ 619 - 0
opms_parent/swaggerui/swagger.yml

@@ -0,0 +1,619 @@
+openapi: 3.0.0
+info:
+    title: micro_learning
+    description: CRM
+    version: 0.0.1
+
+paths:
+  /Test.Nullable:
+    post:
+      tags:
+        - 测试
+      operationId: Test.Nullable
+      summary: 测试空值参数
+      requestBody:
+        required: true
+        content:
+          application/json:
+            schema:
+              oneOf:
+                - $ref: '#/components/schemas/Nullable'
+            examples:
+              AllPass:
+                $ref: '#/components/examples/NullableReqAllPass'
+      responses:
+        200:
+          description: 请求成功
+          content:
+            application/json:
+              examples:
+                success:
+                  $ref: "#/components/examples/success"
+
+  /CtrContract.Get:
+    post:
+      tags:
+        - 合同
+      operationId: CtrContractGet
+      summary: 合同详情
+      requestBody:
+        required: true
+        content:
+          application/json:
+            schema:
+              oneOf:
+                - $ref: '#/components/schemas/IdReq'
+            examples:
+              IdReq:
+                $ref: '#/components/examples/IdReq'
+      responses:
+        200:
+          description: 请求成功
+          content:
+            application/json:
+              examples:
+                success:
+                  $ref: "#/components/examples/success"
+  /CtrContract.List:
+    post:
+      tags:
+        - 合同
+      operationId: CtrContractList
+      summary: 查询合同
+      requestBody:
+        required: true
+        content:
+          application/json:
+            schema:
+              oneOf:
+                - $ref: '#/components/schemas/CtrContractList'
+            examples:
+              CtrContractList:
+                $ref: '#/components/examples/CtrContractList'
+      responses:
+        200:
+          description: 请求成功
+          content:
+            application/json:
+              schema:
+                oneOf:
+                  - $ref: '#/components/schemas/CtrContractListRsp'
+              examples:
+                success:
+                  $ref: "#/components/examples/success"
+  /CtrContract.Add:
+    post:
+      tags:
+        - 合同
+      operationId: CtrContractAdd
+      summary: 新增合同
+      requestBody:
+        required: true
+        content:
+          application/json:
+            schema:
+              oneOf:
+                - $ref: '#/components/schemas/CtrContractAdd'
+            examples:
+              CtrContractAdd:
+                $ref: '#/components/examples/CtrContractAdd'
+      responses:
+        200:
+          description: 请求成功
+          content:
+            application/json:
+              examples:
+                success:
+                  $ref: "#/components/examples/success"
+  /CtrContract.Update:
+    post:
+      tags:
+        - 合同
+      operationId: CtrContractUpdate
+      summary: 更新合同
+      requestBody:
+        required: true
+        content:
+          application/json:
+            schema:
+              oneOf:
+                - $ref: '#/components/schemas/CtrContractUpdate'
+            examples:
+              CtrContractUpdate:
+                $ref: '#/components/examples/CtrContractUpdate'
+      responses:
+        200:
+          description: 请求成功
+          content:
+            application/json:
+              examples:
+                success:
+                  $ref: "#/components/examples/success"
+  /CtrContract.Transfer:
+    post:
+      tags:
+        - 合同
+      operationId: CtrContractTransfer
+      summary: 转移合同
+      requestBody:
+        required: true
+        content:
+          application/json:
+            schema:
+              oneOf:
+                - $ref: '#/components/schemas/CtrContractTransfer'
+            examples:
+              CtrContractTransfer:
+                $ref: '#/components/examples/CtrContractTransfer'
+      responses:
+        200:
+          description: 请求成功
+          content:
+            application/json:
+              examples:
+                success:
+                  $ref: "#/components/examples/success"
+  /CtrContract.Delete:
+    post:
+      tags:
+        - 合同
+      operationId: CtrContractDelete
+      summary: 删除合同
+      requestBody:
+        required: true
+        content:
+          application/json:
+            schema:
+              oneOf:
+                - $ref: '#/components/schemas/IdsReq'
+            examples:
+              IdsReq:
+                $ref: '#/components/examples/IdsReq'
+      responses:
+        200:
+          description: 请求成功
+          content:
+            application/json:
+              examples:
+                success:
+                  $ref: "#/components/examples/success"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 添加这个 swagger ui 会显示授权按钮
+security:
+  - bearerAuth: []
+
+components:
+  securitySchemes:
+    basicAuth:
+      type: http
+      scheme: basic
+    bearerAuth:
+        type: http
+        scheme: bearer
+  schemas:
+    Nullable:
+      type: object
+      required:
+        - Str
+        - Int
+        - Bool
+        - Slice
+      properties:
+        Str:
+          type: string
+          description: 字符串参数
+        Int:
+          type: integer
+          description: Int 参数
+        Bool:
+          type: boolean
+          description: Bool 参数
+        Slice:
+          type: array
+          description: Slice 参数
+          items:
+            type: integer
+    NoArgs:
+      type: object
+      properties:
+        noargs:
+          type: string
+          description: 无参数,但是 body 中必须传输一个 json 空对象 "{}"
+    IdReq:
+      type: object
+      required:
+        - id
+      properties:
+        id:
+          type: integer
+          description: ID
+    IdsReq:
+      type: object
+      required:
+        - id
+      properties:
+        id:
+          type: array
+          description: ID
+          items:
+            type: integer
+
+    CtrContractList:
+      type: object
+      properties:
+
+        beginTime:
+          type: string
+          description: 开始时间
+        endTime:
+          type: string
+          description: 结束时间
+        pageNum:
+          type: integer
+          description: 当前页码
+        pageSize:
+          type: integer
+          description: 每页数
+        orderBy:
+          type: string
+          description: 排序方式
+        searchText:
+          type: string
+          description: 按合同编号,合同名称,客户名称,项目名称搜索
+        contractCode:
+          type: string
+          description: 合同编号
+        contractName:
+          type: string
+          description: 合同名称
+        custId:
+          type: integer
+          description: 关联客户
+        custName:
+          type: string
+          description: 客户名称
+        nboId:
+          type: integer
+          description: 关联项目
+        nboName:
+          type: string
+          description: 项目名称
+        approStatus:
+          type: string
+          description: 审批状态
+        contractType:
+          type: string
+          description: 合同类型
+        contractAmount:
+          type: number
+          description: 合同金额
+        invoiceAmount:
+          type: number
+          description: 已开票金额
+        collectedAmount:
+          type: number
+          description: 已回款金额
+        # contractStartTime:
+        #   type: string
+        #   description: 合同开始时间
+        # contractEndTime:
+        #   type: string
+        #   description: 合同结束时间
+        inchargeId:
+          type: integer
+          description: 负责人ID
+        inchargeName:
+          type: string
+          description: 负责人
+        signatoryId:
+          type: integer
+          description: 公司签约人ID
+        signatoryName:
+          type: string
+          description: 公司签约人
+        distributorId:
+          type: integer
+          description: 经销商ID
+        distributorName:
+          type: string
+          description: 经销商
+    CtrContractAdd:
+      type: object
+      required:
+      properties:
+        contractCode:
+          type: string
+          description: 合同编号
+        contractName:
+          type: string
+          description: 合同名称
+        # custId:
+        #   type: integer
+        #   description: 关联客户
+        # custName:
+        #   type: string
+        #   description: 客户名称
+        nboId:
+          type: integer
+          description: 关联项目
+        # nboName:
+        #   type: string
+        #   description: 项目名称
+        # approStatus:
+        #   type: string
+        #   description: 审批状态
+        contractType:
+          type: string
+          description: 合同类型
+        # contractAmount:
+        #   type: number
+        #   description: 合同金额
+        # invoiceAmount:
+        #   type: number
+        #   description: 已开票金额
+        # collectedAmount:
+        #   type: number
+        #   description: 已回款金额
+        contractStartTime:
+          type: string
+          description: 合同开始时间
+        contractEndTime:
+          type: string
+          description: 合同结束时间
+        inchargeId:
+          type: integer
+          description: 负责人ID
+        inchargeName:
+          type: string
+          description: 负责人
+        signatoryId:
+          type: integer
+          description: 公司签约人ID
+        signatoryName:
+          type: string
+          description: 公司签约人
+        distributorId:
+          type: integer
+          description: 经销商ID
+        distributorName:
+          type: string
+          description: 经销商
+        remark:
+          type: string
+          description: 备注
+        product:
+          type: array
+          description: 产品
+          items:
+            type: object
+            properties:
+              prodId:
+                type: integer
+                description: 关联产品
+              prodNum:
+                type: integer
+                description: 产品数量
+              maintTerm:
+                type: integer
+                description: 维保期
+              sugSalesPrice:
+                type: number
+                description: 建议成交价
+              tranPrice:
+                type: number
+                description: 成交价格
+              remark:
+                type: string
+                description: 备注
+    CtrContractUpdate:
+      type: object
+      required:
+        - id
+      properties:
+        id:
+          type: integer
+          description: Id
+        contractCode:
+          type: string
+          description: 合同编号
+        contractName:
+          type: string
+          description: 合同名称
+        # custId:
+        #   type: integer
+        #   description: 关联客户
+        # custName:
+        #   type: string
+        #   description: 客户名称
+        nboId:
+          type: integer
+          description: 关联项目
+        # nboName:
+        #   type: string
+        #   description: 项目名称
+        # approStatus:
+        #   type: string
+        #   description: 审批状态
+        contractType:
+          type: string
+          description: 合同类型
+        # contractAmount:
+        #   type: number
+        #   description: 合同金额
+        # invoiceAmount:
+        #   type: number
+        #   description: 已开票金额
+        # collectedAmount:
+        #   type: number
+        #   description: 已回款金额
+        contractStartTime:
+          type: string
+          description: 合同开始时间
+        contractEndTime:
+          type: string
+          description: 合同结束时间
+        # inchargeId:
+        #   type: integer
+        #   description: 负责人ID
+        # inchargeName:
+        #   type: string
+        #   description: 负责人
+        signatoryId:
+          type: integer
+          description: 公司签约人ID
+        signatoryName:
+          type: string
+          description: 公司签约人
+        distributorId:
+          type: integer
+          description: 经销商ID
+        distributorName:
+          type: string
+          description: 经销商
+        remark:
+          type: string
+          description: 备注
+        product:
+          type: array
+          description: 产品
+          items:
+            type: object
+            properties:
+              prodId:
+                type: integer
+                description: 关联产品
+              prodNum:
+                type: integer
+                description: 产品数量
+              maintTerm:
+                type: integer
+                description: 维保期
+              sugSalesPrice:
+                type: number
+                description: 建议成交价
+              tranPrice:
+                type: number
+                description: 成交价格
+              remark:
+                type: string
+                description: 备注
+    CtrContractTransfer:
+      type: object
+      required:
+        - id
+      properties:
+        id:
+          type: integer
+          description: Id
+        inchargeId:
+          type: integer
+          description: 负责人ID
+        inchargeName:
+          type: string
+          description: 负责人
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  examples:
+    success:
+      summary: 请求成功
+      value:
+        code: 200,
+        msg: "success"
+    NullableReqAllPass:
+      value:
+          Str: ""
+          Int: 0
+          Bool: false
+          Slice: []
+    NoArgs:
+      value:
+        noargs: ""
+    IdReq:
+      value:
+        id: 2
+    IdsReq:
+      value:
+        id: [1]
+    CtrContractList:
+      value:
+        searchText: ""
+    CtrContractAdd:
+      value:
+        contractCode: "1"
+        contractName: "1"
+        nboId: 1
+        contractType: "1"
+        contractStartTime: "2020-01-01 01:01:01"
+        contractEndTime: "2020-01-01 01:01:01"
+        inchargeId: 1
+        inchargeName: "管理员"
+        signatoryId: 1
+        signatoryName: "管理员"
+        distributorId: 1
+        distributorName: "管理员"
+        remark: "备注"
+        product:
+          -
+            prodId: 2
+            prodNum: 1
+            maintTerm: 1
+            sugSalesPrice: 1
+            tranPrice: 1
+            remark: "备注"
+    CtrContractUpdate:
+      value:
+        id: 2
+        contractCode: "2"
+        contractName: "2"
+        nboId: 2
+        contractType: "2"
+        contractStartTime: "2020-01-01 02:02:02"
+        contractEndTime: "2020-01-01 02:02:02"
+        signatoryId: 1
+        signatoryName: "管理员"
+        distributorId: 1
+        distributorName: "管理员"
+        remark: "备注2"
+        product: []
+    CtrContractTransfer:
+        id: 2
+        inchargeId: 2
+        inchargeName: "管理员2"

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio