改配置名字
This commit is contained in:
		
							parent
							
								
									33c7d27b3b
								
							
						
					
					
						commit
						19d325fb77
					
				| @ -1,7 +1,7 @@ | |||||||
| Name: {{.serviceName}} | Name: {{.serviceName}} | ||||||
| Host: {{.host}} | Host: {{.host}} | ||||||
| Port: {{.port}} | Port: {{.port}} | ||||||
| SourceMysql: "" | DataSource: "" | ||||||
| Auth: | Auth: | ||||||
|     AccessSecret: fusen2023 |     AccessSecret: fusen2023 | ||||||
|     AccessExpire: 604800 |     AccessExpire: 604800 | ||||||
|  | |||||||
| @ -5,6 +5,7 @@ import ( | |||||||
| 	"fusenapi/server/home-user-auth/internal/config" | 	"fusenapi/server/home-user-auth/internal/config" | ||||||
| 	"fusenapi/server/home-user-auth/internal/handler" | 	"fusenapi/server/home-user-auth/internal/handler" | ||||||
| 	"fusenapi/server/home-user-auth/internal/svc" | 	"fusenapi/server/home-user-auth/internal/svc" | ||||||
|  | 	"log" | ||||||
| 	"testing" | 	"testing" | ||||||
| 
 | 
 | ||||||
| 	"github.com/474420502/requests" | 	"github.com/474420502/requests" | ||||||
| @ -17,6 +18,7 @@ var cnf config.Config | |||||||
| var gserver *rest.Server | var gserver *rest.Server | ||||||
| 
 | 
 | ||||||
| func init() { | func init() { | ||||||
|  | 	log.SetFlags(log.Llongfile) | ||||||
| 	gserver = GetTestServer() | 	gserver = GetTestServer() | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| Name: product | Name: product | ||||||
| Host: 0.0.0.0 | Host: 0.0.0.0 | ||||||
| Port: 8889 | Port: 8889 | ||||||
| DataSource: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest | SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest | ||||||
| Auth: | Auth: | ||||||
|   AccessSecret: fusen2023 |   AccessSecret: fusen2023 | ||||||
|   AccessExpire: 60 |   AccessExpire: 60 | ||||||
|  | |||||||
| @ -5,9 +5,10 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"fusenapi/initalize" | 	"fusenapi/initalize" | ||||||
| 	"fusenapi/server/product/internal/config" | 	"fusenapi/server/product/internal/config" | ||||||
|  | 	"net/http" | ||||||
|  | 
 | ||||||
| 	"github.com/golang-jwt/jwt" | 	"github.com/golang-jwt/jwt" | ||||||
| 	"gorm.io/gorm" | 	"gorm.io/gorm" | ||||||
| 	"net/http" |  | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| type ServiceContext struct { | type ServiceContext struct { | ||||||
| @ -20,7 +21,7 @@ func NewServiceContext(c config.Config) *ServiceContext { | |||||||
| 
 | 
 | ||||||
| 	return &ServiceContext{ | 	return &ServiceContext{ | ||||||
| 		Config:    c, | 		Config:    c, | ||||||
| 		MysqlConn: initalize.InitMysql(c.DataSource), | 		MysqlConn: initalize.InitMysql(c.SourceMysql), | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| Name: shopping-cart-confirmation | Name: shopping-cart-confirmation | ||||||
| Host: 0.0.0.0 | Host: 0.0.0.0 | ||||||
| Port: 8892 | Port: 8892 | ||||||
| DataSource: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest | SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest | ||||||
| Auth: | Auth: | ||||||
|     AccessSecret: fusen2023 |     AccessSecret: fusen2023 | ||||||
|     AccessExpire: 604800 |     AccessExpire: 604800 | ||||||
|  | |||||||
| @ -2,11 +2,12 @@ package config | |||||||
| 
 | 
 | ||||||
| import ( | import ( | ||||||
| 	"fusenapi/server/shopping-cart-confirmation/internal/types" | 	"fusenapi/server/shopping-cart-confirmation/internal/types" | ||||||
|  | 
 | ||||||
| 	"github.com/zeromicro/go-zero/rest" | 	"github.com/zeromicro/go-zero/rest" | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| type Config struct { | type Config struct { | ||||||
| 	rest.RestConf | 	rest.RestConf | ||||||
| 	DataSource string | 	SourceMysql string | ||||||
| 	Auth        types.Auth | 	Auth        types.Auth | ||||||
| } | } | ||||||
|  | |||||||
| @ -5,9 +5,10 @@ import ( | |||||||
| 	"fmt" | 	"fmt" | ||||||
| 	"fusenapi/initalize" | 	"fusenapi/initalize" | ||||||
| 	"fusenapi/server/shopping-cart-confirmation/internal/config" | 	"fusenapi/server/shopping-cart-confirmation/internal/config" | ||||||
|  | 	"net/http" | ||||||
|  | 
 | ||||||
| 	"github.com/golang-jwt/jwt" | 	"github.com/golang-jwt/jwt" | ||||||
| 	"gorm.io/gorm" | 	"gorm.io/gorm" | ||||||
| 	"net/http" |  | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| type ServiceContext struct { | type ServiceContext struct { | ||||||
| @ -20,7 +21,7 @@ func NewServiceContext(c config.Config) *ServiceContext { | |||||||
| 
 | 
 | ||||||
| 	return &ServiceContext{ | 	return &ServiceContext{ | ||||||
| 		Config:    c, | 		Config:    c, | ||||||
| 		MysqlConn: initalize.InitMysql(c.DataSource), | 		MysqlConn: initalize.InitMysql(c.SourceMysql), | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user