-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 905bf6b
Showing
7 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.idea/ | ||
go.sum | ||
/log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# web-marisa | ||
🍄 白丝魔理沙网页版 | ||
|
||
### Status | ||
🤍 stop beating | ||
|
||
### Branches | ||
- 0.0.1(in use) | ||
- iris(no longer use) | ||
- gin(no longer use) | ||
|
||
### Frontend | ||
please checkout iris branch, then got it. | ||
|
||
### Contact me | ||
- E-Mail: | ||
- [email protected] | ||
- [email protected] | ||
- QQ: 464189307 | ||
- QQ Group: 795711415 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
app: | ||
name: marisa | ||
ip: 127.0.0.1 | ||
port: 3000 | ||
mode: debug # release | ||
|
||
database: | ||
user: root | ||
password: 123456 | ||
host: 127.0.0.1:3306 | ||
db: fuck | ||
maxIdleConns: 10 | ||
maxOpenConns: 100 | ||
debug: true | ||
|
||
log: | ||
filename: log/marisa.log | ||
maxSize: 500 | ||
maxBackups: 3 | ||
maxAge: 3 | ||
level: "debug" | ||
stdout: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module github.com/gutrse3321/web-marisa | ||
|
||
go 1.15 | ||
|
||
require ( | ||
github.com/gin-gonic/gin v1.6.3 | ||
github.com/google/wire v0.5.0 | ||
github.com/gutrse3321/aki/pkg v0.0.0-20200619033054-c20e563bfd91 | ||
github.com/pkg/errors v0.9.1 | ||
github.com/spf13/viper v1.7.0 | ||
go.uber.org/zap v1.10.0 | ||
golang.org/x/net v0.0.0-20200528225125-3c3fba18258b // indirect | ||
google.golang.org/protobuf v1.24.0 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package src | ||
|
||
import ( | ||
"github.com/google/wire" | ||
"github.com/gutrse3321/aki/pkg/app" | ||
"github.com/gutrse3321/aki/pkg/transports/http" | ||
"github.com/pkg/errors" | ||
"github.com/spf13/viper" | ||
"go.uber.org/zap" | ||
) | ||
|
||
/** | ||
* @Author: Tomonori | ||
* @Date: 2021/8/12 | ||
* @Title: | ||
* --- --- --- | ||
* @Desc: | ||
*/ | ||
|
||
func NewOptions(v *viper.Viper, logger *zap.Logger) (*app.Options, error) { | ||
var err error | ||
|
||
opt := &app.Options{} | ||
if err = v.UnmarshalKey("app", opt); err != nil { | ||
return nil, errors.Wrap(err, "unmarshal app config error") | ||
} | ||
|
||
logger.Info("*** load marisa application config success ***") | ||
return opt, err | ||
} | ||
|
||
func NewApp(opt *app.Options, logger *zap.Logger, httpServer *http.Server) (*app.Application, error) { | ||
application, err := app.New(opt, logger, app.HttpServerOption(httpServer)) | ||
if err != nil { | ||
return nil, errors.Wrap(err, "new application error") | ||
} | ||
|
||
return application, nil | ||
} | ||
|
||
var ProviderSet = wire.NewSet(NewApp, NewOptions) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package controller | ||
|
||
import ( | ||
"github.com/gin-gonic/gin" | ||
httpServer "github.com/gutrse3321/aki/pkg/transports/http" | ||
"net/http" | ||
) | ||
|
||
/** | ||
* @Author: Tomonori | ||
* @Date: 2021/8/12 | ||
* @Title: | ||
* --- --- --- | ||
* @Desc: | ||
*/ | ||
|
||
type IndexController struct { | ||
} | ||
|
||
func NewIndexController() *IndexController { | ||
return &IndexController{} | ||
} | ||
|
||
func CreateInitControllersFn(index *IndexController) httpServer.InitControllers { | ||
return func(g *gin.RouterGroup) { | ||
g.GET("/", index.Home) | ||
} | ||
} | ||
|
||
func (i *IndexController) Home(ctx *gin.Context) { | ||
ctx.JSON(http.StatusOK, &gin.H{ | ||
"message": "お久しぶりです", | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package controller | ||
|
||
import "github.com/google/wire" | ||
|
||
/** | ||
* @Author: Tomonori | ||
* @Date: 2021/8/12 | ||
* @Title: | ||
* --- --- --- | ||
* @Desc: | ||
*/ | ||
var ProviderSet = wire.NewSet( | ||
NewIndexController, | ||
CreateInitControllersFn, | ||
) |