Git Product home page Git Product logo

workuser's Introduction

workUser

任务管理-用户服务

主要提供用户的管理,包含用户的新增、信息修改、删除、三方用户接入等接口等

开发三部曲

创建网关

创建 xxx.api 文件,并运行 goctl api go -api xxx.api -dir .。本项目写的是用户服务,对应的命令就是 goctl api go -api workUser.api -dir .

创建服务的 rpc

编写服务逻辑

启动服务并测试

启动服务

go run service/workUser/cmd/api/workuser.go -f service/workUser/cmd/api/etc/workuser-api.yaml

通过 curl --request POST 'http://127.0.0.1:8001/user/list' 可以获取用户列表,用于检查接口是否正常调用。

功能 list

  • [*] 用户新增
  • [*] 用户修改
  • [*] 用户删除

接口

service workUser-api {
	@handler CreateUser
	post /user/create(CreateUserReq) returns(CreateUserResp)
	@handler FindUser
	get /user/find/:userId () returns(FindUserResp)
	@handler UserList
	post /user/list(UserListReq) returns(UserListRespVo)
	@handler UserDelete
	delete /user/delete/:userId () returns(ResponseVo)
}

新增用户

修改用户信息

删除用户

遇到的问题

  • 使用路由不确定如何获取参数,如 /user/find/:userId,如何获取 userId 呢?
  • 没有 orm 的介绍,不知道如何 migration

参考资料

workuser's People

Contributors

suhanyujie avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.