MCPcopy Create free account
hub / github.com/YMFE/yapi / getMyGroup

Method getMyGroup

server/controllers/group.js:215–232  ·  view source on GitHub ↗
(ctx)

Source from the content-addressed store, hash-verified

213 }
214
215 async getMyGroup(ctx){
216 var groupInst = yapi.getInst(groupModel);
217 let privateGroup = await groupInst.getByPrivateUid(this.getUid());
218 if (!privateGroup) {
219 privateGroup = await groupInst.save({
220 uid: this.getUid(),
221 group_name: 'User-' + this.getUid(),
222 add_time: yapi.commons.time(),
223 up_time: yapi.commons.time(),
224 type: 'private'
225 });
226 }
227 if(privateGroup){
228 ctx.body = yapi.commons.resReturn(privateGroup)
229 }else{
230 ctx.body = yapi.commons.resReturn(null)
231 }
232 }
233
234 /**
235 * 添加项目分组成员

Callers

nothing calls this directly

Calls 3

getByPrivateUidMethod · 0.80
getUidMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected