caipin hace 4 años
padre
commit
5571c49dbd
Se han modificado 3 ficheros con 28 adiciones y 6 borrados
  1. 1 6
      web/api/project_account_api.go
  2. 16 0
      web/backstage/project_account_bs.go
  3. 11 0
      web/utils/utils.go

+ 1 - 6
web/api/project_account_api.go

@@ -104,12 +104,7 @@ func (c *ProjectAccountApi) GetGroup() {
 	// 检索
 	// accountData := c.ServiceProjectAccount.Search(AccountData.Name, projectId)
 
-	groupDate := map[int]string{
-		1: "建设单位",
-		2: "监理单位",
-		3: "施工单位",
-		4: "设计单位",
-	}
+	groupDate := utils.GetAccountGroup()
 	c.Ctx.JSON(iris.Map{
 		"code": 0,
 		"msg":  "",

+ 16 - 0
web/backstage/project_account_bs.go

@@ -299,6 +299,22 @@ func (c *ProjectAccountBs) PostChange() {
 	c.Ctx.JSON(iris.Map{"code": 0, "msg": "编辑成功"})
 }
 
+// @Summary 获得项目账号组
+// @Tags 项目账号相关
+// @Description 获得项目账号组
+// @Security ApiKeyAuth
+// @Success 200 {string} string	"{code:0成功,-1参数类错误,-2服务端内部错误,msg:错误信息}"
+// @Router /api/projectAccount/group [get]
+func (c *ProjectAccountBs) GetGroup() {
+
+	groupDate := utils.GetAccountGroup()
+	c.Ctx.JSON(iris.Map{
+		"code": 0,
+		"msg":  "",
+		"data": groupDate,
+	})
+}
+
 // @Summary 删除账号
 // @Tags 项目设置-管理员
 // @Description 删除账号

+ 11 - 0
web/utils/utils.go

@@ -22,6 +22,17 @@ func SendSMS() {
 
 }
 
+// 获得员工组
+func GetAccountGroup() map[int]string {
+	groupDate := map[int]string{
+		1: "建设单位",
+		2: "监理单位",
+		3: "施工单位",
+		4: "设计单位",
+	}
+	return groupDate
+}
+
 // 字符串转换MAP
 func StringToMap(str string, split string) map[string]string {
 	entries := strings.Split(str, split)