|
|
@@ -21,6 +21,7 @@ type JlBb struct {
|
|
|
// @Accept json
|
|
|
// @Produce json
|
|
|
// @Param code path string true "项目编号"
|
|
|
+// @Param token path string true "token"
|
|
|
// @Success 200 {object} viewmodels.FolderContract "{code:0成功,-1参数类错误,data:viewmodels.ProjectAccount,msg:错误信息}"
|
|
|
// @Router /api/contract/folder [get]
|
|
|
func (c *JlBb) GetFolder() {
|
|
|
@@ -38,6 +39,57 @@ func (c *JlBb) GetFolder() {
|
|
|
return
|
|
|
}
|
|
|
// 1-2.验证jwt
|
|
|
+ err := utils.ValidateJwtBB(data.Token)
|
|
|
+ if err != nil {
|
|
|
+ c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获得项目ID
|
|
|
+ projectDetail := c.ServiceProject.GetNameBs(data.Code)
|
|
|
+ if projectDetail.Id == 0 {
|
|
|
+ c.Ctx.JSON(iris.Map{
|
|
|
+ "code": -1,
|
|
|
+ "msg": "项目不存在",
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获得层级文件夹
|
|
|
+ FolderData := c.ServiceTree.GetAllContractByJL(projectDetail.Id)
|
|
|
+
|
|
|
+ c.Ctx.JSON(iris.Map{
|
|
|
+ "code": 0,
|
|
|
+ "msg": "",
|
|
|
+ "data": FolderData,
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// @Summary 获得合同信息
|
|
|
+// @Tags 合同管理
|
|
|
+// @Description 获得合同信息
|
|
|
+// @Accept json
|
|
|
+// @Produce json
|
|
|
+// @Param code path string true "项目编号"
|
|
|
+// @Param token path string true "token"
|
|
|
+// @Param key path string true "是一个数组,里面代表的名称"
|
|
|
+// @Success 200 {object} viewmodels.FolderContract "{code:0成功,-1参数类错误,data:viewmodels.ProjectAccount,msg:错误信息}"
|
|
|
+// @Router /api/contract/folder [get]
|
|
|
+func (c *JlBb) GetFolder2() {
|
|
|
+
|
|
|
+ // 1.获得数据
|
|
|
+ data := &viewmodels.Jl{}
|
|
|
+ if err := c.Ctx.ReadForm(data); err != nil {
|
|
|
+ c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 1-1.校验是否存在code
|
|
|
+ if err := data.ValidateCodeAToken(); err != nil {
|
|
|
+ c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 1-2.验证jwt
|
|
|
_, err := utils.ValidateJwt(data.Token)
|
|
|
if err != nil {
|
|
|
c.Ctx.JSON(iris.Map{"code": -1, "msg": fmt.Sprintf("%s", err)})
|