|
@@ -4,6 +4,7 @@ import ( |
|
|
"applet/app/db" |
|
|
"applet/app/db" |
|
|
"applet/app/e" |
|
|
"applet/app/e" |
|
|
"applet/app/md/comm" |
|
|
"applet/app/md/comm" |
|
|
|
|
|
"applet/app/svc" |
|
|
"applet/app/utils/cache" |
|
|
"applet/app/utils/cache" |
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement" |
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/implement" |
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" |
|
|
"code.fnuoos.com/EggPlanet/egg_models.git/src/model" |
|
@@ -84,22 +85,7 @@ func AccessRecords(c *gin.Context) { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if req.Index == "" { |
|
|
|
|
|
e.OutErr(c, e.ERR_INVALID_ARGS, nil) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
val, exists := c.Get("user") |
|
|
|
|
|
if !exists { |
|
|
|
|
|
e.OutErr(c, e.ERR_USER_CHECK_ERR, nil) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
user, ok := val.(*model.User) |
|
|
|
|
|
if !ok { |
|
|
|
|
|
e.OutErr(c, e.ERR_USER_CHECK_ERR, nil) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
user := svc.GetUser(c) |
|
|
date := time.Now().Format("2006-01-02") |
|
|
date := time.Now().Format("2006-01-02") |
|
|
recordsDb := implement.NewEggAccessRecordsDb(db.Db) |
|
|
recordsDb := implement.NewEggAccessRecordsDb(db.Db) |
|
|
exist, err := recordsDb.EggAccessRecordsExist(user.Id, date, req.Index) |
|
|
exist, err := recordsDb.EggAccessRecordsExist(user.Id, date, req.Index) |
|
|