Migrate checkin to user service

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2025-12-25 20:30:21 +08:00
parent 9e649d83e5
commit bfeb46a61f
7 changed files with 18 additions and 20 deletions

View File

@@ -78,11 +78,11 @@ func (self *User) Create() error {
}
type UserUpdateInput struct {
Email *string
Nickname *string
Subtitle *string
Avatar *string
Type *string
Email *string `json:"email"`
Nickname *string `json:"nickname"`
Subtitle *string `json:"subtitle"`
Avatar *string `json:"avatar"`
Type *string `json:"type"`
}
func (self *User) UpdateByUserID(userID uuid.UUID, in *UserUpdateInput) error {

View File

@@ -1,12 +0,0 @@
package checkin
import (
"nixcn-cms/middleware"
"github.com/gin-gonic/gin"
)
func Handler(r *gin.RouterGroup) {
r.Use(middleware.JWTAuth())
r.POST("", Checkin)
}

View File

@@ -1,4 +1,4 @@
package checkin
package user
import (
"net/http"

7
service/user/create.go Normal file
View File

@@ -0,0 +1,7 @@
package user
import "github.com/gin-gonic/gin"
func Create(c *gin.Context) {
}

View File

@@ -8,5 +8,8 @@ import (
func Handler(r *gin.RouterGroup) {
r.Use(middleware.JWTAuth())
r.GET("/info", UserInfo)
r.GET("/info", Info)
r.POST("/checkin", Checkin)
r.PATCH("/update", Update)
r.POST("/create", Create)
}

View File

@@ -8,7 +8,7 @@ import (
"github.com/google/uuid"
)
func UserInfo(c *gin.Context) {
func Info(c *gin.Context) {
data := new(data.User)
userId, ok := c.Get("user_id")
if !ok {

0
service/user/update.go Normal file
View File