Skip to content

Commit

Permalink
添加新功能
Browse files Browse the repository at this point in the history
  • Loading branch information
TeenStudyFlow authored Sep 10, 2023
1 parent d23ce23 commit c098f60
Show file tree
Hide file tree
Showing 30 changed files with 8,086 additions and 7,974 deletions.
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2023 ZM25XC TeenStudyFlow

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright (c) 2023 ZM25XC TeenStudyFlow
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
554 changes: 282 additions & 272 deletions README.md

Large diffs are not rendered by default.

66 changes: 33 additions & 33 deletions TeenStudy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
from nonebot import get_driver
from nonebot.plugin import PluginMetadata

from . import models, utils, web

__plugin_meta__ = PluginMetadata(
name='TeenStudy',
description='一个可以自动提交青年大学习的插件',
usage='添加大学习',
homepage="https://github.com/YouthLearning/TeenStudy",
type="application",
supported_adapters={"~onebot.v11"},
extra={
'author': 'ZM25XC TeenStudyFlow',
'version': '0.2.2',
'priority': 50,
}

)

DRIVER = get_driver()


@DRIVER.on_startup
async def startup():
await utils.path.connect()
await utils.utils.admin_init()
await utils.utils.plugin_init()
await utils.utils.resource_init()
await utils.update.update_answer()


DRIVER.on_shutdown(utils.path.disconnect)
from nonebot import get_driver
from nonebot.plugin import PluginMetadata

from . import models, utils, web

__plugin_meta__ = PluginMetadata(
name='青年大学习提交',
description='一个可以自动提交多地区青年大学习的插件',
usage='添加大学习',
homepage="https://github.com/YouthLearning/TeenStudy",
type="application",
supported_adapters={"~onebot.v11"},
extra={
'author': 'TeenStudyFlow',
'version': '0.2.3',
'priority': 50,
}

)

DRIVER = get_driver()


@DRIVER.on_startup
async def startup():
await utils.path.connect()
await utils.utils.admin_init()
await utils.utils.plugin_init()
await utils.utils.resource_init()
await utils.update.update_answer()


DRIVER.on_shutdown(utils.path.disconnect)
2 changes: 1 addition & 1 deletion TeenStudy/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import dxx, accuont
from . import dxx, accuont
218 changes: 109 additions & 109 deletions TeenStudy/models/accuont.py
Original file line number Diff line number Diff line change
@@ -1,109 +1,109 @@
from tortoise import fields
from tortoise.models import Model


class User(Model):
id: int = fields.IntField(pk=True, generated=True, auto_increment=True)
"""自增主键,数据库ID"""
time: int = fields.IntField()
"""创建时间戳"""
self_id: int = fields.IntField(null=True)
"""机器人ID"""
user_id: int = fields.IntField()
"""用户ID"""
password: str = fields.TextField(null=True)
"""登录密码,用于登录web端"""
group_id: int = fields.IntField(null=True)
"""通知群号"""
name: str = fields.TextField()
"""姓名"""
gender: str = fields.TextField(null=True)
"""性别"""
mobile: str = fields.TextField(null=True)
"""手机号"""
area: str = fields.TextField()
"""地区"""
leader: int = fields.IntField(null=True)
"""团支书ID"""
openid: str = fields.TextField(null=True)
"""微信认证ID"""
dxx_id: str = fields.TextField(null=True)
"""大学习用户id,nid或uid"""
university_type: str = fields.TextField(null=True)
"""学校类型"""
university_id: str = fields.TextField(null=True)
"""学校id"""
university: str = fields.TextField()
"""学校名称"""
college_id: str = fields.TextField(null=True)
"""学院id"""
college: str = fields.TextField()
"""学院名称"""
organization_id: str = fields.TextField(null=True)
"""团支部id"""
organization: str = fields.TextField(null=True)
"""团支部名称"""
token: str = fields.TextField(null=True)
"""提交需要的token"""
cookie: str = fields.TextField(null=True)
"""提交要用的cookie"""
auto_submit: bool = fields.BooleanField(default=True)
"""自动提交状态"""
catalogue: str = fields.TextField(null=True)
"""提交期数"""
commit_time: int = fields.IntField(null=True)
"""提交时间"""

class Meta:
table = 'User'
table_description = '用户列表'
indexes = ('time', 'user_id',)


class Commit(Model):
id: int = fields.IntField(pk=True, generated=True, auto_increment=True)
"""自增主键,数据库ID"""
time: int = fields.IntField()
"""提交时间"""
user_id: int = fields.IntField()
"""用户ID"""
name: str = fields.TextField()
"""提交姓名"""
area: str = fields.TextField()
"""提交地区"""
university: str = fields.TextField()
"""学校名称"""
college: str = fields.TextField()
"""学院名称"""
organization: str = fields.TextField(null=True)
"""团支部名称"""
catalogue: str = fields.TextField(null=True)
"""提交期数"""
status: bool = fields.BooleanField(default=False)
"""提交状态"""

class Meta:
table = 'Commit'
table_description = '提交记录'
indexes = ('time', 'user_id',)


class AddUser(Model):
id: int = fields.IntField(pk=True, generated=True, auto_increment=True)
"""自增主键,数据库ID"""
time: int = fields.IntField()
"""申请时间"""
user_id: int = fields.IntField()
"""用户ID"""
group_id: int = fields.IntField()
"""申请群号"""
area: str = fields.TextField()
"""申请地区"""
message_id: int = fields.IntField()
"""申请消息ID"""
status: str = fields.TextField(default="未通过")
"""状态"""

class Meta:
table = 'AddUser'
table_description = '申请列表'
from tortoise import fields
from tortoise.models import Model


class User(Model):
id: int = fields.IntField(pk=True, generated=True, auto_increment=True)
"""自增主键,数据库ID"""
time: int = fields.IntField()
"""创建时间戳"""
self_id: int = fields.IntField(null=True)
"""机器人ID"""
user_id: int = fields.IntField()
"""用户ID"""
password: str = fields.TextField(null=True)
"""登录密码,用于登录web端"""
group_id: int = fields.IntField(null=True)
"""通知群号"""
name: str = fields.TextField()
"""姓名"""
gender: str = fields.TextField(null=True)
"""性别"""
mobile: str = fields.TextField(null=True)
"""手机号"""
area: str = fields.TextField()
"""地区"""
leader: int = fields.IntField(null=True)
"""团支书ID"""
openid: str = fields.TextField(null=True)
"""微信认证ID"""
dxx_id: str = fields.TextField(null=True)
"""大学习用户id,nid或uid"""
university_type: str = fields.TextField(null=True)
"""学校类型"""
university_id: str = fields.TextField(null=True)
"""学校id"""
university: str = fields.TextField()
"""学校名称"""
college_id: str = fields.TextField(null=True)
"""学院id"""
college: str = fields.TextField()
"""学院名称"""
organization_id: str = fields.TextField(null=True)
"""团支部id"""
organization: str = fields.TextField(null=True)
"""团支部名称"""
token: str = fields.TextField(null=True)
"""提交需要的token"""
cookie: str = fields.TextField(null=True)
"""提交要用的cookie"""
auto_submit: bool = fields.BooleanField(default=True)
"""自动提交状态"""
catalogue: str = fields.TextField(null=True)
"""提交期数"""
commit_time: int = fields.IntField(null=True)
"""提交时间"""

class Meta:
table = 'User'
table_description = '用户列表'
indexes = ('time', 'user_id',)


class Commit(Model):
id: int = fields.IntField(pk=True, generated=True, auto_increment=True)
"""自增主键,数据库ID"""
time: int = fields.IntField()
"""提交时间"""
user_id: int = fields.IntField()
"""用户ID"""
name: str = fields.TextField()
"""提交姓名"""
area: str = fields.TextField()
"""提交地区"""
university: str = fields.TextField()
"""学校名称"""
college: str = fields.TextField()
"""学院名称"""
organization: str = fields.TextField(null=True)
"""团支部名称"""
catalogue: str = fields.TextField(null=True)
"""提交期数"""
status: bool = fields.BooleanField(default=False)
"""提交状态"""

class Meta:
table = 'Commit'
table_description = '提交记录'
indexes = ('time', 'user_id',)


class AddUser(Model):
id: int = fields.IntField(pk=True, generated=True, auto_increment=True)
"""自增主键,数据库ID"""
time: int = fields.IntField()
"""申请时间"""
user_id: int = fields.IntField()
"""用户ID"""
group_id: int = fields.IntField()
"""申请群号"""
area: str = fields.TextField()
"""申请地区"""
message_id: int = fields.IntField()
"""申请消息ID"""
status: str = fields.TextField(default="未通过")
"""状态"""

class Meta:
table = 'AddUser'
table_description = '申请列表'
Loading

0 comments on commit c098f60

Please sign in to comment.