up
This commit is contained in:
		
							parent
							
								
									9ac7597a62
								
							
						
					
					
						commit
						fa9b4f5e78
					
				| @ -1,8 +1,8 @@ | |||||||
| package api | package api | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
| 	"zjmud.xyz/phyer/rbcp/controllers" | 	"gitea.zjmud.xyz/phyer/rbcp/controllers" | ||||||
| 	"zjmud.xyz/phyer/rbcp/middleware" | 	"gitea.zjmud.xyz/phyer/rbcp/middleware" | ||||||
| 
 | 
 | ||||||
| 	"github.com/gin-gonic/gin" | 	"github.com/gin-gonic/gin" | ||||||
| ) | ) | ||||||
|  | |||||||
| @ -1,10 +1,10 @@ | |||||||
| package controllers | package controllers | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
|  | 	"gitea.zjmud.xyz/phyer/rbcp/models" | ||||||
|  | 	"gitea.zjmud.xyz/phyer/rbcp/services" | ||||||
| 	"net/http" | 	"net/http" | ||||||
| 	"time" | 	"time" | ||||||
| 	"zjmud.xyz/phyer/rbcp/models" |  | ||||||
| 	"zjmud.xyz/phyer/rbcp/services" |  | ||||||
| 
 | 
 | ||||||
| 	"github.com/gin-gonic/gin" | 	"github.com/gin-gonic/gin" | ||||||
| 	"github.com/golang-jwt/jwt/v5" | 	"github.com/golang-jwt/jwt/v5" | ||||||
|  | |||||||
| @ -1,10 +1,10 @@ | |||||||
| package controllers | package controllers | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
|  | 	"gitea.zjmud.xyz/phyer/rbcp/models" | ||||||
|  | 	"gitea.zjmud.xyz/phyer/rbcp/services" | ||||||
| 	"net/http" | 	"net/http" | ||||||
| 	"time" | 	"time" | ||||||
| 	"zjmud.xyz/phyer/rbcp/models" |  | ||||||
| 	"zjmud.xyz/phyer/rbcp/services" |  | ||||||
| 
 | 
 | ||||||
| 	"github.com/gin-gonic/gin" | 	"github.com/gin-gonic/gin" | ||||||
| 	"github.com/golang-jwt/jwt/v5" | 	"github.com/golang-jwt/jwt/v5" | ||||||
|  | |||||||
| @ -1,9 +1,9 @@ | |||||||
| package controllers | package controllers | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
|  | 	"gitea.zjmud.xyz/phyer/rbcp/models" | ||||||
|  | 	"gitea.zjmud.xyz/phyer/rbcp/services" | ||||||
| 	"net/http" | 	"net/http" | ||||||
| 	"zjmud.xyz/phyer/rbcp/models" |  | ||||||
| 	"zjmud.xyz/phyer/rbcp/services" |  | ||||||
| 
 | 
 | ||||||
| 	"github.com/gin-gonic/gin" | 	"github.com/gin-gonic/gin" | ||||||
| ) | ) | ||||||
|  | |||||||
| @ -1,9 +1,9 @@ | |||||||
| package controllers | package controllers | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
|  | 	"gitea.zjmud.xyz/phyer/rbcp/models" | ||||||
|  | 	"gitea.zjmud.xyz/phyer/rbcp/services" | ||||||
| 	"net/http" | 	"net/http" | ||||||
| 	"zjmud.xyz/phyer/rbcp/models" |  | ||||||
| 	"zjmud.xyz/phyer/rbcp/services" |  | ||||||
| 
 | 
 | ||||||
| 	"github.com/gin-gonic/gin" | 	"github.com/gin-gonic/gin" | ||||||
| ) | ) | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.mod
									
									
									
									
									
								
							| @ -1,4 +1,4 @@ | |||||||
| module zjmud.xyz/phyer/rbcp | module gitea.zjmud.xyz/phyer/rbcp | ||||||
| 
 | 
 | ||||||
| go 1.21 | go 1.21 | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								main.go
									
									
									
									
									
								
							| @ -1,6 +1,6 @@ | |||||||
| package main | package main | ||||||
| 
 | 
 | ||||||
| import "zjmud.xyz/phyer/rbcp/server" | import "gitea.zjmud.xyz/phyer/rbcp/server" | ||||||
| 
 | 
 | ||||||
| func main() { | func main() { | ||||||
| 	server.Start() | 	server.Start() | ||||||
|  | |||||||
| @ -2,8 +2,8 @@ package middleware | |||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
| 	"fmt" | 	"fmt" | ||||||
|  | 	"gitea.zjmud.xyz/phyer/rbcp/config" | ||||||
| 	"net/http" | 	"net/http" | ||||||
| 	"zjmud.xyz/phyer/rbcp/config" |  | ||||||
| 
 | 
 | ||||||
| 	"github.com/gin-gonic/gin" | 	"github.com/gin-gonic/gin" | ||||||
| 	"github.com/golang-jwt/jwt/v5" | 	"github.com/golang-jwt/jwt/v5" | ||||||
|  | |||||||
| @ -1,8 +1,8 @@ | |||||||
| package repositories | package repositories | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
|  | 	"gitea.zjmud.xyz/phyer/rbcp/models" | ||||||
| 	"gorm.io/gorm" | 	"gorm.io/gorm" | ||||||
| 	"zjmud.xyz/phyer/rbcp/models" |  | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| func CreatePermission(permission *models.Permission) error { | func CreatePermission(permission *models.Permission) error { | ||||||
|  | |||||||
| @ -1,8 +1,8 @@ | |||||||
| package repositories | package repositories | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
|  | 	"gitea.zjmud.xyz/phyer/rbcp/models" | ||||||
| 	"gorm.io/gorm" | 	"gorm.io/gorm" | ||||||
| 	"zjmud.xyz/phyer/rbcp/models" |  | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| func CreateRole(role *models.Role) error { | func CreateRole(role *models.Role) error { | ||||||
|  | |||||||
| @ -1,8 +1,8 @@ | |||||||
| package repositories | package repositories | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
|  | 	"gitea.zjmud.xyz/phyer/rbcp/models" | ||||||
| 	"gorm.io/gorm" | 	"gorm.io/gorm" | ||||||
| 	"zjmud.xyz/phyer/rbcp/models" |  | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| func GetUserByUsername(username string) (*models.User, error) { | func GetUserByUsername(username string) (*models.User, error) { | ||||||
|  | |||||||
| @ -1,8 +1,8 @@ | |||||||
| package repositories | package repositories | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
|  | 	"gitea.zjmud.xyz/phyer/rbcp/models" | ||||||
| 	"gorm.io/gorm" | 	"gorm.io/gorm" | ||||||
| 	"zjmud.xyz/phyer/rbcp/models" |  | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| func CreateUserGroup(group *models.UserGroup) error { | func CreateUserGroup(group *models.UserGroup) error { | ||||||
|  | |||||||
| @ -1,8 +1,8 @@ | |||||||
| package server | package server | ||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
| 	"zjmud.xyz/phyer/rbcp/api" | 	"gitea.zjmud.xyz/phyer/rbcp/api" | ||||||
| 	"zjmud.xyz/phyer/rbcp/config" | 	"gitea.zjmud.xyz/phyer/rbcp/config" | ||||||
| 
 | 
 | ||||||
| 	"github.com/gin-gonic/gin" | 	"github.com/gin-gonic/gin" | ||||||
| ) | ) | ||||||
|  | |||||||
| @ -2,8 +2,8 @@ package services | |||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
| 	"errors" | 	"errors" | ||||||
| 	"zjmud.xyz/phyer/rbcp/models" | 	"gitea.zjmud.xyz/phyer/rbcp/models" | ||||||
| 	"zjmud.xyz/phyer/rbcp/repositories" | 	"gitea.zjmud.xyz/phyer/rbcp/repositories" | ||||||
| 
 | 
 | ||||||
| 	"golang.org/x/crypto/bcrypt" | 	"golang.org/x/crypto/bcrypt" | ||||||
| ) | ) | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| package services | package services | ||||||
| 
 | 
 | ||||||
| import "zjmud.xyz/phyer/rbcp/models" | import "gitea.zjmud.xyz/phyer/rbcp/models" | ||||||
| 
 | 
 | ||||||
| func CreateRole(role *models.Role) error { | func CreateRole(role *models.Role) error { | ||||||
| 	return repositories.CreateRole(role) | 	return repositories.CreateRole(role) | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| package services | package services | ||||||
| 
 | 
 | ||||||
| import "zjmud.xyz/phyer/rbcp/models" | import "gitea.zjmud.xyz/phyer/rbcp/models" | ||||||
| 
 | 
 | ||||||
| func CreateUser(user *models.User) error { | func CreateUser(user *models.User) error { | ||||||
| 	return repositories.CreateUser(user) | 	return repositories.CreateUser(user) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 zhangkun9038@dingtalk.com
						zhangkun9038@dingtalk.com