feat: enhance the mine api.

This commit is contained in:
lishuang
2023-07-22 17:16:55 +08:00
parent 9bc02bdfcb
commit f1cbde414f
3 changed files with 8 additions and 9 deletions
+6
View File
@@ -159,6 +159,12 @@ func (this *SpaceMemberController) Mine(writer http.ResponseWriter, request *htt
user := this.checkUser(request)
spaceMember := this.spaceMemberDao.FindBySpaceUuidAndUserUuid(spaceUuid, user.Uuid)
if spaceMember == nil {
spaceMember = &SpaceMember{SpaceUuid: spaceUuid, Role: SPACE_MEMBER_GUEST}
}
if user.Role == USER_ROLE_ADMINISTRATOR {
spaceMember.Role = SPACE_MEMBER_ROLE_ADMIN
}
return this.Success(spaceMember)
+2
View File
@@ -5,6 +5,8 @@ import (
)
const (
//read only member
SPACE_MEMBER_GUEST = "GUEST"
//read only member
SPACE_MEMBER_ROLE_READ_ONLY = "READ_ONLY"
//read write member
-9
View File
@@ -11,13 +11,4 @@ func main() {
core.APPLICATION = &support.TankApplication{}
core.APPLICATION.Start()
//getlastmodified
//Sat, 8 Jul 2023 12:08:15 GMT
//dict := make(map[string]string)
//dict["getlastmodified"] = "Sat, 8 Jul 2023 12:08:15 GMT"
//marshal, err := jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(dict)
//if err != nil {
// return
//}
//println(marshal)
}