-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
389 changed files
with
186,678 additions
and
2 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,7 @@ | ||
.DS_Store | ||
build/release | ||
upload | ||
logs | ||
web_src/dist | ||
web_src/node_modules | ||
web_src/yarn.lock |
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 |
---|---|---|
@@ -1,2 +1,41 @@ | ||
# znj | ||
面向中小团队,基于文档的项目协作工具,免费开源 | ||
# ZNJ[智能记] 中小团队协作工具 | ||
|
||
#### 🎉 简介 | ||
|
||
可以简单替代 tower 的基于文档的团队协作工具 | ||
|
||
- 支持待办事项管理 | ||
- 支持项目任务管理 | ||
- 支持 markdown,流程图文档 | ||
|
||
#### 🚀 源码安装 | ||
|
||
```bash | ||
git clone https://github.com/itmisx/znj | ||
cd znj/web_src | ||
yarn install | ||
yarn build | ||
cd ../ | ||
go mod tidy | ||
GOOS=linux GOARCH=amd64 go build -o znj main.go | ||
# 可以自定义配置 /etc/znj.yaml | ||
./znj | ||
``` | ||
|
||
#### 🚀 Docker | ||
|
||
```bash | ||
git clone https://github.com/itmisx/znj | ||
cd znj/docker | ||
# 自定义配置文件 | ||
# 编辑docker-compose.yaml | ||
# volumes: | ||
# - ./etc/znj.yaml:/etc/znj.yaml | ||
docker-compose up -d | ||
``` | ||
|
||
#### 🎉 截图 | ||
|
||
 | ||
|
||
#### LICENSE |
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,10 @@ | ||
git clone https://github.com/itmisx/znj | ||
cd znj/web_src | ||
yarn | ||
yarn build | ||
cd ../ | ||
go mod tidy | ||
rm -rf build/release/* | ||
GOOS=linux GOARCH=amd64 go build -o build/release/znj main.go | ||
cp -r etc build/release | ||
docker build -t znj:0.0.1 . |
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,36 @@ | ||
package config | ||
|
||
import ( | ||
"github.com/itmisx/gormx" | ||
"github.com/itmisx/logger" | ||
"github.com/itmisx/redisx" | ||
"github.com/spf13/viper" | ||
) | ||
|
||
var Conf struct { | ||
HTTPPort string `mapstructure:"http_port"` | ||
Mysql gormx.Config `mapstructure:"mysql"` | ||
Redis redisx.Config `mapstructure:"redis"` | ||
Logger logger.Config `mapstructure:"logger"` | ||
DefalutLang string `mapstructure:"default_lang"` | ||
AllowMethods []string `mapstructure:"allow_methods"` | ||
AllowHeaders []string `mapstructure:"allow_headers"` | ||
AdminUser struct { | ||
Username string `mapstructure:"username"` | ||
Password string `mapstructure:"password"` | ||
} `mapstructure:"admin_user"` | ||
} | ||
|
||
// 解析配置 | ||
func ParseConf() { | ||
vp := viper.New() | ||
vp.SetConfigName("znj") | ||
vp.SetConfigType("yaml") | ||
vp.AddConfigPath("./etc") | ||
vp.AddConfigPath("/etc") | ||
err := vp.ReadInConfig() | ||
if err != nil { | ||
panic(err.Error()) | ||
} | ||
vp.Unmarshal(&Conf) | ||
} |
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 @@ | ||
package config | ||
|
||
import ( | ||
"github.com/itmisx/gormx" | ||
"gorm.io/gorm" | ||
) | ||
|
||
var _db *gorm.DB | ||
|
||
// MysqlInit mysql数据库初始化 | ||
func MysqlInit(cfg gormx.Config) (err error) { | ||
_db, err = gormx.New(cfg) | ||
if err != nil { | ||
panic(err) | ||
} | ||
return | ||
} | ||
|
||
// 获取一个数据库对象 | ||
func NewDB() *gorm.DB { | ||
return _db | ||
} |
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,16 @@ | ||
package config | ||
|
||
import "github.com/itmisx/redisx" | ||
|
||
// 实例变量 | ||
var _cli redisx.Client | ||
|
||
// RedisInit | ||
func RedisInit(conf redisx.Config) { | ||
_cli = redisx.New(conf) | ||
} | ||
|
||
// NewRDB 获取redis链接 | ||
func NewRDB() redisx.Client { | ||
return _cli | ||
} |
Oops, something went wrong.