You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
813 B
813 B
STEP 1:
增加GenXorm目录【包括<span class="ambiguous-code-point tooltip" data-content=": [U+FF1A] is confusable with : [U+003A]"><span class="char">:</span></span>models和templates子目录】<span class="ambiguous-code-point tooltip" data-content=", [U+FF0C] is confusable with , [U+002C]"><span class="char">,</span></span>使用Xorm命令<span class="ambiguous-code-point tooltip" data-content=", [U+FF0C] is confusable with , [U+002C]"><span class="char">,</span></span>生成数据库实体DAO【参考<span class="ambiguous-code-point tooltip" data-content=": [U+FF1A] is confusable with : [U+003A]"><span class="char">:</span></span>https://github.com/xormplus/xorm】;
1.1: go get github.com/go-xorm/cmd/xorm
1.2: go get github.com/go-sql-driver/mysql
1.3: cd genxorm
xorm reverse mysql root:dsideal@(127.0.0.1:3306)/db_dataex?charset=utf8 Templates
STEP 2<span class="ambiguous-code-point tooltip" data-content=": [U+FF1A] is confusable with : [U+003A]"><span class="char">:</span></span>
引入Gin;
2.1 go get github.com/gin-gonic/gin
STEP 3<span class="ambiguous-code-point tooltip" data-content=": [U+FF1A] is confusable with : [U+003A]"><span class="char">:</span></span>
引入Swagger;
3.1 go get "github.com/swaggo/gin-swagger"
go get "github.com/swaggo/gin-swagger/swaggerFiles"
3.2 在main文件增加引用<span class="ambiguous-code-point tooltip" data-content=": [U+FF1A] is confusable with : [U+003A]"><span class="char">:</span></span> _ "dsDataex/docs"
3.3 生成各个应用接口
swag init -d myreport -g ../main.go -o docs/myreport
3.4 生成全部接口
swag init
STEP 4<span class="ambiguous-code-point tooltip" data-content=": [U+FF1A] is confusable with : [U+003A]"><span class="char">:</span></span>
引入Grpc;
go get "github.com/golang/protobuf"