mirror of
https://github.com/eyebluecn/tank.git
synced 2024-04-21 12:32:16 +00:00
feat: enhance the mine api.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user