pibigstar / Go Todo
Licence: gpl-2.0
微信小程序 todo后端,采用GoFrame框架搭建,包含微信认证、token管理、发送微信模板消息等
Stars: ✭ 60
Programming Languages
go
31211 projects - #10 most used programming language
Projects that are alternatives of or similar to Go Todo
to-do-list-acf-to-rest-api
To do list using the plugin WordPress REST API
Stars: ✭ 24 (-60%)
Mutual labels: todo, todolist
Duckygo
一个同时支持Session以及JWT的高性能高可用 Golang Restful API 脚手架 !
Stars: ✭ 57 (-5%)
Mutual labels: gorm, redis
todoscreensaver
A screensaver that reads a text file from somewhere on your PC.
Stars: ✭ 20 (-66.67%)
Mutual labels: todo, todolist
api
Mirror of vikunja from https://code.vikunja.io/api
Stars: ✭ 119 (+98.33%)
Mutual labels: todo, todolist
Backlog
Simple desktop app for storing lists of items (todo, tasks, backlog items)
Stars: ✭ 407 (+578.33%)
Mutual labels: todo, todolist
Mirakel Android
Easy task management for professionals
Stars: ✭ 382 (+536.67%)
Mutual labels: todo, todolist
outspline
Extensible outliner and personal time organizer to manage todo lists, schedule tasks, remind events.
Stars: ✭ 41 (-31.67%)
Mutual labels: todo, todolist
Go Gin Api
基于 Gin 进行模块化设计的 API 框架,封装了常用功能,使用简单,致力于进行快速的业务研发。比如,支持 cors 跨域、jwt 签名验证、zap 日志收集、panic 异常捕获、trace 链路追踪、prometheus 监控指标、swagger 文档生成、viper 配置文件解析、gorm 数据库组件、gormgen 代码生成工具、graphql 查询语言、errno 统一定义错误码、gRPC 的使用 等等。
Stars: ✭ 730 (+1116.67%)
Mutual labels: gorm, viper
todo-list
A practical web application built with Node.js, Express, and MySQL for you to readily record, view, and manage your tasks with an account: Create, view, edit, delete, filter, and sort expenses are as easy as pie 🥧
Stars: ✭ 18 (-70%)
Mutual labels: todo, todolist
meemo
Run a lightweight Meemo server with database on Docker with docker-compose
Stars: ✭ 18 (-70%)
Mutual labels: todo, todolist
Tasky
Tasky is a task management app made with SwiftUI.
Stars: ✭ 22 (-63.33%)
Mutual labels: todo, todolist
Todo.txt Cli
☑️ A simple and extensible shell script for managing your todo.txt file.
Stars: ✭ 4,725 (+7775%)
Mutual labels: todo, todolist
1. Todo
此项目是todo小程序的后台,todo是一个任务发布提醒小程序,你可以加入一个组织,在里面可以给成员发布一些待完成的任务,主要服务于学校和一些公司之间,为了更加方便的管理任务需求而制作的一款小程序应用。
2. 使用技术
2.1 后端请求接收与处理
使用goframe
框架, 版本 1.9.10
安装:
go get -u github.com/gogf/gf
服务绑定:
func init() {
s := g.Server()
s.BindHandler("/wxLogin", wxLogin)
}
数据校验与获取
type WxLoginRequest struct {
Code string `json:"code" gvalid:"
}
// 校验
if err := gvalid.CheckStruct(wxLoginRequest, nil); err != nil {
log.Error("code为空", "err", err.String())
r.Response.WriteJson(errorResponse(err.String()))
return
}
// 获取前端请求数据
r.GetToStruct(wxLoginRequest)
启动
s := g.Server()
port := config.ServerConfig.Port
s.SetPort(int(port))
host := config.ServerConfig.Host
s.Domain(host)
// 开启日志
s.SetLogPath("log/todo.log")
s.SetAccessLogEnabled(true)
s.SetErrorLogEnabled(true)
s.Run()
2.2 配置文件读取
使用viper
框架
安装:
go get -u github.com/spf13/viper
使用:
// 设置配置文件名
configName := fmt.Sprintf("%s-%s", "config", ServerStartupFlags.Environment)
viper.SetConfigName(configName)
// 设置配置文件路径
viper.AddConfigPath("conf")
// 解析配置
viper.ReadInConfig()
// 获取server配置,map类型
viper.GetStringMap("server")
2.3 日志输出
使用zap
框架
安装:
go get -u go.uber.org/zap
使用:见utils/log/log.go
2.4 定时任务
使用cron
框架
安装:
go get -u github.com/robfig/cron
使用:
c := cron.New()
for _, job := range jobs.GetJobs() {
log.Info("job启动", "job name", job.Name())
c.AddFunc(job.Cron(), func() {
defer func() {
if err := recover(); err != nil {
log.Error("job 运行出错", "job name", job.Name(), "error", err)
}
}()
// 执行任务
job.Run()
})
}
c.Start()
defer c.Stop()
3. 部署
3.1 打包成可执行文件
cd scripts
./build.bat
3.2 编译成镜像
docker build -t go-todo .
3.3 启动容器
docker run -dit -p 7410:7410 --name todo-container go-todo /bin/bash
3.4 进入容器
docker exec -it todo-container /bin/bash
3.5 删除镜像
# 停止容器
docker stop todo-container
# 删除容器
docker rm todo-container
# 删除镜像
docker rmi go-todo
相关项目
项目结构
展开查看
.
├─conf
├─config
├─constant
├─controller
├─cron
│ └─jobs
├─https
├─log
│ └─todo.log
│ └─access
├─middleware
├─models
│ └─db
├─scritps
├─test
│ ├─config
│ ├─model
│ └─utils
├─utils
│ └─logger
└─vendor
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].