Skip to content

添加了对.json配置文件的支持#49

Merged
longfangsong merged 10 commits intoSHUReeducation:masterfrom
takemorenap:addjson
Aug 3, 2020
Merged

添加了对.json配置文件的支持#49
longfangsong merged 10 commits intoSHUReeducation:masterfrom
takemorenap:addjson

Conversation

@takemorenap
Copy link
Copy Markdown

@takemorenap takemorenap commented Aug 3, 2020

What problem does this PR solve?

Issue Number: #36

Problem Summary:
添加了对.json的支持.
ps. 如果merge了的话关一下 #48 那边的修改在这里也应用了
pps. 这里的json结构和yaml不完全一样, 手动把tablename,fieldscomplex收在了一个新的table下面(原本的结构不知道怎么去处理这个部分 如果有资料可以学的话发我一下)

What is changed and how it works?

-f指定的文件的扩展名自行选用对应的函数.(见configFile\configFile.go:42)

  1. 删除了原本的LoadYaml函数, 添加了FromJson函数.
  2. 添加了example\student.json文件
  3. 添加了withCaseunmarshalJSON接口

What's Changed:

chcanged configFile\configFile.go
changed configFile\database\database.go
new example\student.json
changed main.go
changed utility\withCase\withCase.go

takemorenap and others added 9 commits August 2, 2020 06:00
add a flag --force ,but it wont change anything about Action
when given 'output path' not existing will make finfo := nil and  cause runtime error
add a support to json
now the cli tool can generate target dir by json, and it will choose the load function by the extension of the file assigned by '-f'.
@longfangsong
Copy link
Copy Markdown
Collaborator

ps. 如果merge了的话关一下 #48 那边的修改在这里也应用了

下次可以就发两个pr,我会merge的。

pps. 这里的json结构和yaml不完全一样, 手动把tablename,fields和complex收在了一个新的table下面(原本的结构不知道怎么去处理这个部分 如果有资料可以学的话发我一下)

Golang的文档就是大便,Rust不知道比他高到哪里去了。

What is changed and how it works?

这个没必要写那么详细 😄,稍微写点就得了

Comment thread configFile/configFile.go Outdated
Comment thread configFile/fields/database/database.go Outdated
Comment thread main.go Outdated
Comment thread utility/withCase/withCase.go
Comment thread configFile/configFile.go Outdated
Copy link
Copy Markdown
Collaborator

@longfangsong longfangsong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有些地方可以改下

Copy link
Copy Markdown
Collaborator

@longfangsong longfangsong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@longfangsong longfangsong merged commit 6e6019b into SHUReeducation:master Aug 3, 2020
@takemorenap takemorenap deleted the addjson branch August 23, 2020 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants