1.更换软件协议为AGPL
2.切换项目名称为Hua.Todo
@@ -37,7 +37,7 @@ bld/
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
src/TodoList.Maui/wwwroot/
|
||||
src/Hua.Todo.Maui/wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
@@ -363,6 +363,6 @@ MigrationBackup/
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
/Setup/Output
|
||||
/TodoList/Output
|
||||
/src/TodoList.Maui/Output
|
||||
/src/TodoList.Host/todolist.db
|
||||
/Hua.Todo/Output
|
||||
/src/Hua.Todo.Maui/Output
|
||||
/src/Hua.Todo.Host/Hua.Todo.db
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
// 如果已更改目标框架,请确保更新程序路径。
|
||||
"program": "${workspaceFolder}/src/TodoList.Host/bin/Debug/net10.0/TodoList.Host.dll",
|
||||
"program": "${workspaceFolder}/src/Hua.Todo.Host/bin/Debug/net10.0/Hua.Todo.Host.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/src/TodoList.Host",
|
||||
"cwd": "${workspaceFolder}/src/Hua.Todo.Host",
|
||||
"stopAtEntry": false,
|
||||
// 启用在启动 ASP.NET Core 时启动 Web 浏览器。有关详细信息: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
|
||||
"serverReadyAction": {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"type": "process",
|
||||
"args": [
|
||||
"build",
|
||||
"${workspaceFolder}/src/TodoList.Host/TodoList.Host.csproj",
|
||||
"${workspaceFolder}/src/Hua.Todo.Host/Hua.Todo.Host.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary;ForceNoAlign"
|
||||
],
|
||||
@@ -19,7 +19,7 @@
|
||||
"type": "process",
|
||||
"args": [
|
||||
"publish",
|
||||
"${workspaceFolder}/src/TodoList.Host/TodoList.Host.csproj",
|
||||
"${workspaceFolder}/src/Hua.Todo.Host/Hua.Todo.Host.csproj",
|
||||
"/property:GenerateFullPaths=true",
|
||||
"/consoleloggerparameters:NoSummary;ForceNoAlign"
|
||||
],
|
||||
@@ -33,7 +33,7 @@
|
||||
"watch",
|
||||
"run",
|
||||
"--project",
|
||||
"${workspaceFolder}/src/TodoList.Host/TodoList.Host.csproj"
|
||||
"${workspaceFolder}/src/Hua.Todo.Host/Hua.Todo.Host.csproj"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<Solution>
|
||||
<Configurations>
|
||||
<Platform Name="Any CPU" />
|
||||
<Platform Name="ARM64" />
|
||||
<Platform Name="x64" />
|
||||
<Platform Name="x86" />
|
||||
</Configurations>
|
||||
<Folder Name="/src/">
|
||||
<Project Path="src/Hua.Todo.Application/Hua.Todo.Application.csproj">
|
||||
<Build Solution="Debug|*" Project="false" />
|
||||
</Project>
|
||||
<Project Path="src/Hua.Todo.Core/Hua.Todo.Core.csproj" />
|
||||
<Project Path="src/Hua.Todo.Host/Hua.Todo.Host.csproj" />
|
||||
<Project Path="src/Hua.Todo.Maui/Hua.Todo.Maui.csproj">
|
||||
<Build Solution="Debug|*" Project="false" />
|
||||
</Project>
|
||||
</Folder>
|
||||
</Solution>
|
||||
@@ -0,0 +1,664 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under
|
||||
section 7. This requirement modifies the requirement in
|
||||
section 4 to "keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have received it separately.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has
|
||||
interactive interfaces that do not display Appropriate Legal
|
||||
Notices, your work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
Machine-Readable Corresponding Source under the terms of this
|
||||
License, in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that
|
||||
product model, to give anyone who possesses the object code
|
||||
either (1) a copy of the Corresponding Source for all the
|
||||
software in the product that is covered by this License, on a
|
||||
durable physical medium customarily used for software
|
||||
interchange, for a price no more than your reasonable cost of
|
||||
physically performing this conveying of source, or (2) access to
|
||||
copy the Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in
|
||||
accord with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to
|
||||
the Corresponding Source in the same way through the same place
|
||||
at no further charge. You need not require recipients to copy
|
||||
the Corresponding Source along with the object code. If the
|
||||
place to copy the object code is a network server, the
|
||||
Corresponding Source may be on a different server (operated by
|
||||
you or a third party) that supports equivalent copying
|
||||
facilities, provided you maintain clear directions next to the
|
||||
object code saying where the Corresponding Source is located.
|
||||
Regardless of what server hosts the Corresponding Source, you
|
||||
remain obligated to ensure that it is available for as long as
|
||||
needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal,
|
||||
family, or household purposes, or (2) anything designed or sold for
|
||||
incorporation into a dwelling. In determining whether a product is a
|
||||
consumer product, doubtful cases shall be resolved in favor of
|
||||
coverage. For a particular product received by a particular user,
|
||||
"normally used" refers to a typical or common use of that class of
|
||||
product, regardless of the status of the particular user or of the way
|
||||
in which the particular user actually uses, or expects or is expected
|
||||
to use, the product. A product is a consumer product regardless of
|
||||
whether the product has substantial commercial, industrial or
|
||||
non-consumer uses, unless such uses represent the only significant
|
||||
mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to
|
||||
install and execute modified versions of a covered work in that User
|
||||
Product from a modified version of its Corresponding Source. The
|
||||
information must suffice to ensure that the continued functioning of
|
||||
the modified object code is in no case prevented or interfered with
|
||||
solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a surcharge for exercising rights granted under this
|
||||
License, and you may not impose any litigation (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that any patent
|
||||
claim is infringed by making, using, selling, offering for sale, or
|
||||
importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor
|
||||
version, but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make
|
||||
payment to the third party based on the extent of your activity of
|
||||
conveying the work, and under which the third party grants, to any of
|
||||
the parties who would receive the covered work from you, a
|
||||
discriminatory patent license (a) in connection with copies of the
|
||||
covered work conveyed by you (or copies made from those copies), or
|
||||
(b) primarily for and in connection with specific products or
|
||||
compilations that contain the covered work, unless you entered into
|
||||
that arrangement, or that patent license was granted, prior to 28
|
||||
March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your
|
||||
version supports such interaction) an opportunity to receive the
|
||||
Corresponding Source of your version by providing access to the
|
||||
Corresponding Source from a network server at no charge, through some
|
||||
standard or customary means of facilitating copying of software. This
|
||||
Corresponding Source shall include the Corresponding Source for any
|
||||
work covered by version 3 of the GNU General Public License that is
|
||||
incorporated pursuant to the following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Affero General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero
|
||||
General Public License "or any later version" applies to it, you have
|
||||
the option of following the terms and conditions either of that
|
||||
numbered version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number
|
||||
of the GNU Affero General Public License, you may choose any version
|
||||
ever published by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that
|
||||
proxy's public statement of acceptance of a version permanently
|
||||
authorizes you to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
|
||||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
|
||||
OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU
|
||||
ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
|
||||
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
|
||||
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
|
||||
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
|
||||
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
|
||||
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
@@ -0,0 +1,229 @@
|
||||
GNU AFFERO 通用公共许可证
|
||||
第 3 版,2007 年 11 月 19 日
|
||||
|
||||
版权所有 © 2007 自由软件基金会公司 <https://fsf.org/>
|
||||
每个人都被允许复制和分发本许可证文件的逐字副本,但不允许进行更改。
|
||||
|
||||
序言
|
||||
|
||||
GNU Affero 通用公共许可证是一个自由的、允许复制的软件和其他类型作品的许可,在网络服务器软件的情况下,它是专门为确保与社区合作而设计。
|
||||
|
||||
大多数软件和其他实用作品的许可都是为了剥夺您分享和改变作品的自由。相比之下,我们的通用公共许可证的目的是保证您分享和改变一个程序的所有版本的自由——确保它对所有用户都是自由软件。
|
||||
|
||||
当我们谈论自由软件时,我们指的是自由,而不是价格。我们的通用公共许可证的设计是为了确保您有分发自由软件副本的自由(如果您愿意,还可以收费),您可以收到源代码,或者如果您想得到它,您可以改变软件或在新的自由程序中使用它的片段,而且您知道您可以做这些事情。
|
||||
|
||||
使用我们通用公共许可证的开发者通过两个步骤保护您的权利:(1) 主张软件的版权,(2) 向您提供本许可证,允许您合法地复制、分发和/或修改该软件。
|
||||
|
||||
捍卫所有用户自由的一个次要好处是,如果程序的替代版本得到广泛使用,就可以供其他开发者使用。许多自由软件的开发者对由此产生的合作感到振奋和鼓舞。然而,在网络服务器上使用的软件,这种结果可能无法实现。GNU 通用公共许可证允许制作一个修改过的版本,让公众在服务器上访问它,而不需要向公众发布其源代码。
|
||||
|
||||
GNU Affero 通用公共许可证是专门设计来确保在这种情况下,修改后的源代码可以被社区使用。它要求网络服务器的运营商向该服务器的用户提供运行在那里的修改版本的源代码。因此,在一个可公开访问的服务器上公开使用一个修改过的版本,使公众能够获得修改过的版本的源代码。
|
||||
|
||||
一个较早的许可证,称为 Affero 通用公共许可证,由 Affero 发布,旨在实现类似目标。这是一个不同的许可证,不是 Affero GPL 的一个版本,但 Affero 已经发布了 Affero GPL 的一个新版本,允许在这个许可证下重新许可。
|
||||
|
||||
关于复制、分发和修改的确切条款和条件如下。
|
||||
|
||||
条款与条件
|
||||
|
||||
0. 定义.
|
||||
|
||||
“本许可证”是指 GNU Affero 通用公共许可证的第 3 版。
|
||||
|
||||
“版权”也指适用于其他类型作品的类似版权的法律,如半导体掩模。
|
||||
|
||||
“本程序”是指在本许可证下许可的任何有版权的作品。每个被许可人都被称呼为“您”。“被许可人”和“接受者”可以是个人或组织。
|
||||
|
||||
“修改”作品是指以需要版权许可的方式复制或改编该作品的全部或部分内容,而不是制作一个完全的副本。由此产生的作品被称为早期作品的“修改版”或“基于”早期作品的作品。
|
||||
|
||||
一个“涵盖的作品”是指未经修改的程序或基于该程序的作品。
|
||||
|
||||
“传播”作品是指在未经许可的情况下,对作品做任何事情,使您在适用的版权法下承担直接或间接的侵权责任,但在计算机上执行或修改私人副本除外。传播包括复制、分发(无论是否修改)、向公众提供,在一些国家还包括其他活动。
|
||||
|
||||
“传达”作品是指使其他各方能够制作或接受副本的任何一种传播。仅仅是通过计算机网络与用户互动,而没有转让副本,并不是传达。
|
||||
|
||||
交互式用户界面显示“适当的法律声明”的程度是,它包括一个方便和显眼的功能,(1) 显示适当的版权声明,(2) 告诉用户该作品没有保证(除了提供保证的范围),被许可人可以根据本许可传达该作品,以及如何查看本许可证的副本。如果界面呈现的是一个用户命令或选项的列表,如菜单,列表中的显著项符合这一标准。
|
||||
|
||||
1. 源代码.
|
||||
|
||||
作品的“源代码”是指对作品进行修改的首选形式。“目标代码”是指作品的任何非源代码形式。
|
||||
|
||||
“标准接口”是指由公认的标准机构定义的官方标准,或者在为特定编程语言指定的接口的情况下,在该语言的开发者中广泛使用的接口。
|
||||
|
||||
可执行作品的“系统库”包括除作品整体以外的任何内容:(a) 包含在主要组件包装的正常形式中,但不属于该主要组件的一部分,且 (b) 仅用于使作品能够与该主要组件一起使用,或用于实现公众可获得源代码形式的标准接口。在本文中,“主要组件”是指运行可执行作品的特定操作系统(如果有的话)的主要基本组件(内核、窗口系统等),或用于产生该作品的编译器,或用于运行它的目标代码解释器。
|
||||
|
||||
目标代码形式作品的“对应源代码”是指生成、安装和(对于可执行作品)运行目标代码以及修改作品所需的全部源代码,包括控制这些活动的脚本。但是,它不包括作品的系统库,或在执行这些活动时未经修改使用的通用工具或普遍可获得的自由程序,但它们不属于作品的一部分。例如,对应源代码包括与作品源文件相关的接口定义文件,以及作品被专门设计为需要的共享库和动态链接子程序的源代码,例如通过这些子程序与作品其他部分之间的密切数据通信或控制流。
|
||||
|
||||
对应源代码不需要包括用户可以从对应源代码的其他部分自动重新生成的任何内容。
|
||||
|
||||
源代码形式作品的对应源代码就是该作品本身。
|
||||
|
||||
2. 基本许可.
|
||||
|
||||
本许可证下授予的所有权利都是在程序的版权期限内授予的,并且在满足规定条件的情况下是不可撤销的。本许可证明确肯定了您运行未经修改程序的无限许可。运行涵盖作品的输出只有在输出内容构成涵盖作品的情况下才受本许可证约束。本许可证承认您的合理使用权或其他同等权利,正如版权法所规定的。
|
||||
|
||||
只要您的许可证仍然有效,您可以制作、运行和传播您不传达的涵盖作品,且无需遵守任何条件。您可以为了让他人专门为您进行修改,或为您提供运行这些作品的设施,而向他人传达涵盖作品,前提是您在传达所有您不控制版权的材料时遵守本许可证的条款。为您制作或运行涵盖作品的人必须完全代表您,在您的指示和控制下进行,其条款必须禁止他们在与您的关系之外制作您的版权材料的任何副本。
|
||||
|
||||
在任何其他情况下的传达只有在下述条件下才被允许。不允许转许可;第 10 条使其变得没有必要。
|
||||
|
||||
3. 保护用户的合法权利免受反绕过法的侵害.
|
||||
|
||||
根据任何履行 1996 年 12 月 20 日通过的 WIPO 版权条约第 11 条规定的义务的适用法律,或禁止或限制绕过此类措施的类似法律,任何涵盖作品都不应被视为有效技术措施的一部分。
|
||||
|
||||
当您传达涵盖作品时,您放弃任何禁止绕过技术措施的法律权利,其程度是此类绕过是通过行使本许可证下关于涵盖作品的权利而实现的,并且您放弃任何限制作品运行或修改的意图,作为针对作品用户执行您或第三方禁止绕过技术措施的合法权利的手段。
|
||||
|
||||
4. 传达逐字副本.
|
||||
|
||||
您可以按收到的程序源代码原样,通过任何媒介传达逐字副本,前提是您在每个副本上显著且适当地发布适当的版权声明;完整保留所有声明本许可证及根据第 7 条增加的任何非许可条款适用于该代码的通知;完整保留所有关于没有任何保证的通知;并随程序向所有接受者提供本许可证的副本。
|
||||
|
||||
您可以对传达的每个副本收取任何价格或不收取费用,并且您可以收取费用提供支持或保证保护。
|
||||
|
||||
5. 传达修改后的源代码版本.
|
||||
|
||||
您可以根据第 4 条的条款传达基于程序的作品,或从程序产生该作品的修改,以源代码的形式,前提是您还满足以下所有条件:
|
||||
|
||||
a) 作品必须带有显著的通知,说明您修改了它,并给出相关日期。
|
||||
b) 作品必须带有显著的通知,说明它是根据本许可证和根据第 7 条增加的任何条件发布的。这一要求修改了第 4 条中“完整保留所有通知”的要求。
|
||||
c) 您必须根据本许可证向任何拥有副本的人许可整个作品。因此,本许可证将连同任何适用的第 7 条附加条款一起适用于整个作品及其所有部分,无论它们是如何包装的。本许可证不准许以任何其他方式许可作品,但如果您单独收到了此类准许,它并不使该准许无效。
|
||||
d) 如果作品有交互式用户界面,每个界面都必须显示适当的法律声明;但是,如果程序有交互式界面但不显示适当的法律声明,您的作品则不需要使它们显示。
|
||||
|
||||
将涵盖作品与其他单独且独立的作品(其性质不是涵盖作品的扩展,也不是与其组合形成更大的程序)在一个存储或分发介质卷中汇编,如果汇编及其产生的版权不被用于限制汇编用户的访问或合法权利,超出单个作品所允许的范围,则被称为“聚合体”。在聚合体中包含涵盖作品不会导致本许可证适用于聚合体的其他部分。
|
||||
|
||||
6. 传达非源代码形式.
|
||||
|
||||
您可以根据第 4 条和第 5 条的条款,以目标代码形式传达涵盖作品,前提是您还根据本许可证的条款,通过以下方式之一传达机器可读的对应源代码:
|
||||
|
||||
a) 在物理产品(包括物理分发介质)中或体现其中传达目标代码,随附固定在通常用于软件交换的耐用物理介质上的对应源代码。
|
||||
b) 在物理产品(包括物理分发介质)中或体现其中传达目标代码,随附一份书面报价,有效期至少三年,并且在您为该产品型号提供备件或客户支持期间一直有效,向任何拥有目标代码的人提供 (1) 产品中受本许可证约束的所有软件的对应源代码副本,固定在通常用于软件交换的耐用物理介质上,价格不超过您物理执行此传达源代码的合理成本,或 (2) 从网络服务器免费下载对应源代码的访问权限。
|
||||
c) 随附提供对应源代码的书面报价副本,传达目标代码的单个副本。这种替代方案只在偶尔且非商业的情况下被允许,并且只有在您根据第 6b 小节收到带有此类报价的目标代码时才被允许。
|
||||
d) 通过从指定地点提供访问权限(免费或收费)传达目标代码,并以同样的方式通过同一地点提供对对应源代码的等效访问,不收取额外费用。您不需要要求接受者随目标代码一起复制对应源代码。如果复制目标代码的地点是网络服务器,对应源代码可以在不同的服务器上(由您或第三方运营),该服务器支持等效的复制设施,前提是您在目标代码旁边保留明确的指示,说明对应源代码的位置。无论哪个服务器托管对应源代码,您仍有义务确保它在满足这些要求所需的时间内是可用的。
|
||||
e) 使用对等传输传达目标代码,前提是您告知其他对等方,根据第 6d 小节,该作品的目标代码和对应源代码正免费向公众提供。
|
||||
|
||||
目标代码的独立部分,其源代码作为系统库被排除在对应源代码之外,不需要在传达目标代码作品时包括在内。
|
||||
|
||||
“用户产品”是指 (1)“消费品”,指通常用于个人、家庭或家务目的的任何有形个人财产,或 (2) 任何设计或销售用于安装在住宅中的东西。在确定产品是否为消费品时,疑点应倾向于涵盖。对于特定用户收到的特定产品,“通常使用”是指该类产品的典型或常见用法,无论特定用户的身份或特定用户实际使用、预期或被预期使用产品的方式。产品是消费品,无论产品是否有实质性的商业、工业或非消费用途,除非此类用途代表了产品的唯一显著使用模式。
|
||||
|
||||
用户产品的“安装信息”是指从对应源代码的修改版在用户产品中安装和执行涵盖作品的修改版所需的任何方法、程序、授权密钥或其他信息。信息必须足以确保修改后的目标代码的持续运行在任何情况下都不会仅仅因为进行了修改而被阻止或干扰。
|
||||
|
||||
如果您根据本条在用户产品中、随附用户产品或专门用于用户产品传达目标代码作品,且传达作为永久或固定期限(无论交易如何描述)将用户产品的占有和使用权转让给接受者的交易的一部分发生,根据本条传达的对应源代码必须随附安装信息。但如果您或任何第三方都不保留在用户产品上安装修改后的目标代码的能力(例如,作品已安装在 ROM 中),则此要求不适用。
|
||||
|
||||
提供安装信息的要求不包括继续为由接受者修改或安装的作品,或为其被修改或安装的用户产品提供支持服务、保证或更新的要求。当修改本身实质性地且不利地影响网络的运行或违反跨网络通信的规则和协议时,可以拒绝访问网络。
|
||||
|
||||
根据本条传达的对应源代码和提供的安装信息必须采用公开记录的格式(且具有公众可获得源代码形式的实现),并且必须不需要特殊的密码或密钥进行解包、读取或复制。
|
||||
|
||||
7. 附加条款.
|
||||
|
||||
“附加许可”是通过对本许可证的一个或多个条件进行例外处理来补充其条款。适用于整个程序的附加许可应被视为包含在本许可证中,只要它们在适用法律下是有效的。如果附加许可仅适用于程序的一部分,该部分可以在这些许可下单独使用,但整个程序仍然受本许可证约束,而不考虑附加许可。
|
||||
|
||||
当您传达涵盖作品的副本时,您可以选择从该副本或其中的任何部分删除任何附加许可。(在您修改作品时,附加许可可以被编写为在某些情况下要求删除它们。)您可以为您拥有或可以提供适当版权许可的材料放置附加许可,并将其添加到涵盖作品中。
|
||||
|
||||
尽管有本许可证的任何其他规定,对于您添加到涵盖作品中的材料,您可以(如果得到该材料版权持有者的授权)用以下条款补充本许可证的条款:
|
||||
|
||||
a) 以不同于本许可证第 15 条和第 16 条条款的方式放弃保证或限制责任;或者
|
||||
b) 要求在该材料中或在包含该材料的作品显示的适当法律声明中保留指定的合理法律声明或作者署名;或者
|
||||
c) 禁止歪曲该材料的来源,或要求修改后的版本以合理的方式标记为不同于原始版本;或者
|
||||
d) 限制出于宣传目的使用该材料的许可人或作者的名字;或者
|
||||
e) 拒绝根据商标法授予使用某些商号、商标或服务标志的权利;或者
|
||||
f) 要求该材料的传达者(或其修改版)向该材料的许可人和作者提供赔偿,如果传达者对接受者承担了合同责任,而这些合同责任直接强加给了这些许可人和作者。
|
||||
|
||||
所有其他非许可性的附加条款都被视为第 10 条意义上的“进一步限制”。如果您收到的程序或其任何部分包含一份声明其受本许可证约束的通知,以及一个属于进一步限制的条款,您可以删除该条款。如果一份许可证文件包含进一步限制,但允许在本许可证下重新许可或传达,您可以添加受该许可证文件条款约束的涵盖作品材料,前提是进一步限制在重新许可或传达后不再存续。
|
||||
|
||||
如果您根据本条向涵盖作品添加条款,您必须在相关的源文件中放置适用于这些文件的附加条款的声明,或指示在哪里可以找到适用条款的通知。
|
||||
|
||||
附加条款,无论是许可性的还是非许可性的,都可以以单独编写的许可证的形式陈述,或陈述为例外;上述要求在任何一种情况下都适用。
|
||||
|
||||
8. 终止.
|
||||
|
||||
除非本许可证明确规定,否则您不得传播或修改涵盖作品。任何以其他方式传播或修改作品的尝试都是无效的,并将自动终止您在本许可证下的权利(包括根据第 11 条第三段授予的任何专利许可)。
|
||||
|
||||
但是,如果您停止所有违反本许可证的行为,那么您从特定版权持有者处获得的许可证将恢复:(a) 临时恢复,除非且直到版权持有者明确且最终终止您的许可证,以及 (b) 永久恢复,如果版权持有者在停止后 60 天内未能通过某种合理方式通知您违反行为。
|
||||
|
||||
此外,如果版权持有者通过某种合理方式通知您违反行为,且这是您第一次收到该版权持有者关于违反本许可证(针对任何作品)的通知,并且您在收到通知后 30 天内纠正了违反行为,则您从该特定版权持有者处获得的许可证将永久恢复。
|
||||
|
||||
根据本条终止您的权利并不会终止根据本许可证从您那里获得副本或权利的各方的许可证。如果您的权利已被终止且未永久恢复,您就不符合根据第 10 条获得相同材料新许可证的资格。
|
||||
|
||||
9. 拥有副本不需要接受.
|
||||
|
||||
您不需要为了接收或运行程序的副本而接受本许可证。仅作为使用对等传输接收副本的结果而发生的涵盖作品的附属传播同样不需要接受。但是,除本许可证外,没有任何内容准许您传播或修改任何涵盖作品。如果您不接受本许可证,这些行为就侵犯了版权。因此,通过修改或传播涵盖作品,您表示您接受本许可证以这样做。
|
||||
|
||||
10. 下游接受者的自动许可.
|
||||
|
||||
每次您传达涵盖作品时,接受者会自动从原始许可人处获得根据本许可证运行、修改和传播该作品的许可。您不负责强制第三方遵守本许可证。
|
||||
|
||||
“实体交易”是指转移组织控制权、或其几乎所有资产、或细分组织、或合并组织的交易。如果涵盖作品的传播是由实体交易产生的,那么该交易中收到作品副本的每一方也会收到该方的利益前任在上一段下拥有或可以给予的关于该作品的任何许可,以及从利益前任那里获得作品对应源代码的权利(如果前任拥有它或可以通过合理的努力获得它)。
|
||||
|
||||
您不得对本许可证授予或确认的权利的行使施加任何进一步的限制。例如,您不得为行使本许可证授予的权利收取附加费,也不得发起任何诉讼(包括在诉讼中提出交叉索赔或反诉),指控程序的任何部分侵犯了任何专利权利。
|
||||
|
||||
11. 专利.
|
||||
|
||||
“贡献者”是指授权在本许可证下使用程序或程序所基于的作品的版权持有者。如此许可的作品被称为该贡献者的“贡献者版本”。
|
||||
|
||||
贡献者的“基本专利权利”是指贡献者拥有或控制的所有专利权利,无论是已经获得的还是以后获得的,如果以本许可证允许的某种方式制作、使用或销售其贡献者版本,就会被侵犯,但不包括仅由于对贡献者版本的进一步修改而会被侵犯的权利。在本定义中,“控制”包括以符合本许可证要求的方式授予专利转许可的权利。
|
||||
|
||||
每个贡献者授予您非独占的、全球性的、免版税的专利许可,在贡献者的基本专利权利下,制作、使用、销售、要约销售、进口以及以其他方式运行、修改和传播其贡献者版本的内容。
|
||||
|
||||
在以下三段中,“专利许可”是指任何明示的协议或承诺,无论名称如何,不执行专利(如行使专利的明示许可或不就专利侵权提起诉讼的承诺)。向一方“授予”此类专利许可意味着达成此类协议或承诺,不对该方执行专利。
|
||||
|
||||
如果您传达涵盖作品,明知依赖于一份专利许可,而该作品的对应源代码无法通过公开可用的网络服务器或其他易于访问的方式供任何人根据本许可证的条款免费复制,那么您必须:(1) 使对应源代码可以这样获得,或 (2) 安排剥夺您自己从该特定作品的专利许可中获得的利益,或 (3) 以符合本许可证要求的方式,安排将专利许可延伸到下游接受者。“明知依赖”意味着您实际知悉,如果不是因为有专利许可,您在某个国家传达涵盖作品,或您的接受者在某个国家使用涵盖作品,就会侵犯该国家的一项或多项您有理由相信是有效的可识别专利。
|
||||
|
||||
如果根据单一交易或安排,或与之相关,您传达或通过促成传达来传播涵盖作品,并向接收涵盖作品的某些方授予专利许可,授权他们使用、传播、修改或传达涵盖作品的特定副本,那么您授予的专利许可将自动延伸到涵盖作品的所有接受者及基于它的作品。
|
||||
|
||||
如果专利许可的覆盖范围不包括本许可证专门授予的一项或多项权利、禁止行使这些权利、或以不行使这些权利为条件,则该专利许可被视为“歧视性”的。如果您与从事软件分发业务的第三方达成安排,根据该安排,您根据传达作品的活动程度向第三方支付费用,且第三方根据该安排向从您处获得涵盖作品的任何方授予歧视性的专利许可,则您不得传达涵盖作品:(a) 与您传达的涵盖作品副本(或从这些副本制作的副本)相关,或 (b) 主要针对包含涵盖作品的特定产品或汇编,除非您在 2007 年 3 月 28 日之前进入该安排或该专利许可已被授予。
|
||||
|
||||
本许可证中的任何内容都不应被解释为排除或限制根据适用专利法可能为您提供的任何默示许可或其他侵权抗辩。
|
||||
|
||||
12. 不得损害他人的自由.
|
||||
|
||||
如果强加给您的条件(无论是通过法院命令、协议还是其他方式)与本许可证的条件相抵触,它们并不能免除您遵守本许可证的条件。如果您无法在传达涵盖作品的同时满足本许可证下的义务和任何其他相关义务,那么您根本不得传达它。例如,如果您同意要求您从传达程序的人那里收取版税的条款,那么您能够同时满足这些条款和本许可证的唯一方法就是完全不传达程序。
|
||||
|
||||
13. 远程网络交互;与 GNU 通用公共许可证一起使用.
|
||||
|
||||
尽管本许可证有任何其他规定,如果您修改程序,您的修改版必须显著地向所有通过计算机网络与其远程交互的用户(如果您的版本支持此类交互)提供一个机会,通过某种标准的或惯常的方便复制软件的方式,从网络服务器免费获得您版本的对应源代码。该对应源代码应包括根据下一段包含的受 GNU 通用公共许可证第 3 版约束的任何作品的对应源代码。
|
||||
|
||||
尽管本许可证有任何其他规定,您有权将任何涵盖作品与根据 GNU 通用公共许可证第 3 版许可的作品链接或组合成单一的组合作品,并传达产生的作品。本许可证的条款将继续适用于涵盖作品的部分,但与其组合的作品将继续受 GNU 通用公共许可证第 3 版的约束。
|
||||
|
||||
14. 本许可证的修订版.
|
||||
|
||||
自由软件基金会可能会不时发布 GNU Affero 通用公共许可证的修订版和/或新版本。此类新版本在精神上将与当前版本相似,但在处理新问题或关注点时可能在细节上有所不同。
|
||||
|
||||
每个版本都有一个区分版本号。如果程序指定某个特定版本号的 GNU Affero 通用公共许可证“或任何更高版本”适用于它,您可以选择遵守该版本号或自由软件基金会发布的任何更高版本的条款和条件。如果程序没有指定 GNU Affero 通用公共许可证的版本号,您可以选择自由软件基金会曾发布的任何版本。
|
||||
|
||||
如果程序指定代理人可以决定将来可以使用哪个版本的 GNU Affero 通用公共许可证,则该代理人公开声明接受某个版本,即永久授权您为该程序选择该版本。
|
||||
|
||||
以后的许可证版本可能会给您额外的或不同的许可。但是,由于您选择遵循以后的版本,不会对任何作者或版权持有者施加额外的义务。
|
||||
|
||||
15. 免责声明.
|
||||
|
||||
在适用法律允许的范围内,对本程序不提供任何保证。除非另有书面说明,版权持有者和/或其他方“按原样”提供本程序,不提供任何形式的保证,无论是明示的还是暗示的,包括但不限于对适销性和特定用途适用性的暗示保证。关于程序的质量和性能的全部风险均由您承担。如果程序被证明有缺陷,您承担所有必要的维修、修复或纠正费用。
|
||||
|
||||
16. 责任限制.
|
||||
|
||||
除非适用法律要求或书面同意,否则任何版权持有者或任何其他根据上述许可修改和/或传达程序的方,都不对您的损害负责,包括因使用或无法使用程序而产生的任何一般的、特殊的、偶然的或间接的损害(包括但不限于数据丢失或数据变得不准确,或由您或第三方遭受的损失,或程序无法与任何其他程序一起运行),即使该持有者或其他方已被告知此类损害的可能性。
|
||||
|
||||
17. 第 15 条和第 16 条的解释.
|
||||
|
||||
如果上述免责声明和责任限制无法根据其条款产生当地法律效力,审查法院应适用最接近于绝对放弃与程序相关的所有民事责任的当地法律,除非收费随附程序的副本提供保证或承担责任。
|
||||
|
||||
条款与条件结束
|
||||
|
||||
如何将这些条款应用于您的新程序
|
||||
|
||||
如果您开发了一个新程序,并且您希望它能给公众带来最大的用处,实现这一点的最好方法是使其成为自由软件,每个人都可以在这些条款下重新分发和更改它。
|
||||
|
||||
为此,请在程序中附上以下通知。最安全的方法是将它们附在每个源文件的开头,以最有效地陈述保证的排除;每个文件至少应该有“版权”行和指向完整通知位置的指针。
|
||||
|
||||
<给出程序名称及其用途的简要说明的一行内容。>
|
||||
版权所有 (C) <年份> <作者姓名>
|
||||
|
||||
本程序是自由软件:您可以根据自由软件基金会发布的 GNU Affero 通用公共许可证的条款(许可证的第 3 版,或(由您选择)任何更高版本)重新分发和/或修改它。
|
||||
|
||||
发布本程序的目的是希望它有用,但不提供任何保证;甚至没有适销性或特定用途适用性的暗示保证。有关详细信息,请参阅 GNU Affero 通用公共许可证。
|
||||
|
||||
您应该已经随本程序收到了一份 GNU Affero 通用公共许可证的副本。如果没有,请参阅 <https://www.gnu.org/licenses/>。
|
||||
|
||||
还请添加如何通过电子邮件和信函与您联系的信息。
|
||||
|
||||
如果您的软件可以通过计算机网络与用户进行远程交互,您还应该确保它为用户提供了一种获取其源代码的方法。例如,如果您的程序是一个 Web 应用程序,其界面可以显示一个指向代码存档的“源代码”链接。提供源代码的方法有很多,不同的程序会有不同的解决方案;具体要求见第 13 条。
|
||||
|
||||
如果有必要,您还应该让您的雇主(如果您是程序员)或学校(如果有的话)为程序签署一份“版权免责声明”。有关这方面的更多信息,以及如何应用和遵循 GNU AGPL,请参阅 <https://www.gnu.org/licenses/>。
|
||||
|
||||
---
|
||||
*注:这是 GNU Affero 通用公共许可证 (AGPL) 的非官方中文翻译。它不是由自由软件基金会发布的,也不具有法律效力。只有英文原文才具有法律效力。*
|
||||
@@ -1,6 +1,6 @@
|
||||
# TodoList 跨平台待办事项管理应用
|
||||
# Hua.Todo 跨平台代办管理应用
|
||||
|
||||
一个基于 MAUI + WebView 架构开发的跨平台待办事项管理应用,支持 Windows、macOS、Android、iOS 和 Linux(预览)平台。通过 HTTP API 实现前后端通信,提供轻量、高效的任务管理体验。
|
||||
一个基于 MAUI + WebView 架构开发的跨平台代办管理应用,支持 Windows、macOS、Android、iOS 和 Linux(预览)平台。通过 HTTP API 实现前后端通信,提供轻量、高效的任务管理体验。
|
||||
|
||||
## 🚀 功能特点
|
||||
|
||||
@@ -54,12 +54,12 @@
|
||||
#### 1. 克隆或下载项目
|
||||
```bash
|
||||
git clone <仓库地址>
|
||||
cd TodoList
|
||||
cd Hua.Todo
|
||||
```
|
||||
|
||||
#### 2. 启动后端 API
|
||||
```bash
|
||||
cd src/TodoList.Api
|
||||
cd src/Hua.Todo.Api
|
||||
dotnet restore
|
||||
dotnet ef database update
|
||||
dotnet run
|
||||
@@ -68,7 +68,7 @@ API 将在 `http://localhost:5173` 启动
|
||||
|
||||
#### 3. 启动前端 Web
|
||||
```bash
|
||||
cd src/TodoList.Web
|
||||
cd src/Hua.Todo.Web
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
@@ -84,21 +84,21 @@ npm run dev
|
||||
|
||||
### 项目结构
|
||||
```
|
||||
TodoList/
|
||||
Hua.Todo/
|
||||
├── docs/ # 文档目录
|
||||
│ ├── 产品需求文档.md
|
||||
│ ├── 产品需求文档-1.1.0.md
|
||||
│ ├── 技术设计文档.md
|
||||
│ └── 代码规范文档.md
|
||||
├── src/ # 源代码目录
|
||||
│ ├── TodoList.Core/ # 核心业务逻辑层
|
||||
│ ├── Hua.Todo.Core/ # 核心业务逻辑层
|
||||
│ │ ├── Entities/ # 实体类
|
||||
│ │ │ ├── Task.cs
|
||||
│ │ │ └── TaskPriority.cs
|
||||
│ │ └── Interfaces/ # 接口定义
|
||||
│ │ ├── ITaskRepository.cs
|
||||
│ │ └── ITaskService.cs
|
||||
│ ├── TodoList.Api/ # 后端 API 项目
|
||||
│ ├── Hua.Todo.Api/ # 后端 API 项目
|
||||
│ │ ├── Controllers/ # API 控制器
|
||||
│ │ │ └── TasksController.cs
|
||||
│ │ ├── Services/ # 业务服务
|
||||
@@ -111,8 +111,8 @@ TodoList/
|
||||
│ │ ├── Models/ # 数据模型
|
||||
│ │ │ └── TaskModels.cs
|
||||
│ │ ├── Program.cs # API 入口
|
||||
│ │ └── TodoList.Api.csproj # API 项目文件
|
||||
│ ├── TodoList.Web/ # 前端 Web 项目 (Vue.js)
|
||||
│ │ └── Hua.Todo.Api.csproj # API 项目文件
|
||||
│ ├── Hua.Todo.Web/ # 前端 Web 项目 (Vue.js)
|
||||
│ │ ├── public/ # 静态资源
|
||||
│ │ ├── src/
|
||||
│ │ │ ├── api/ # API 调用
|
||||
@@ -128,7 +128,7 @@ TodoList/
|
||||
│ │ ├── package.json # 依赖配置
|
||||
│ │ ├── vite.config.ts # Vite 配置
|
||||
│ │ └── tsconfig.json # TypeScript 配置
|
||||
│ └── TodoList.slnx # 解决方案文件
|
||||
│ └── Hua.Todo.slnx # 解决方案文件
|
||||
├── .gitignore # Git 忽略文件
|
||||
└── README.md # 项目说明文档
|
||||
```
|
||||
@@ -143,13 +143,13 @@ TodoList/
|
||||
|
||||
## 🎯 核心模块说明
|
||||
|
||||
### TodoList.Core
|
||||
### Hua.Todo.Core
|
||||
核心业务逻辑层,定义领域模型和业务规则,提供核心业务接口。
|
||||
|
||||
### TodoList.Api
|
||||
### Hua.Todo.Api
|
||||
后端 API 项目,提供 RESTful API 接口,处理业务逻辑,管理数据访问和持久化。
|
||||
|
||||
### TodoList.Web
|
||||
### Hua.Todo.Web
|
||||
前端 Web 项目,基于 Vue.js 3 + TypeScript,提供用户界面,通过 HTTP API 与后端通信。
|
||||
|
||||
## 🔄 版本更新
|
||||
@@ -176,13 +176,13 @@ TodoList/
|
||||
|
||||
## 📄 许可证
|
||||
|
||||
本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情
|
||||
本项目采用 AGPL-3.0 许可证 - 查看 [LICENSE](LICENSE) (英文) 或 [LICENSE.zh-CN](LICENSE.zh-CN) (中文) 文件了解详情
|
||||
|
||||
## 📞 联系方式
|
||||
|
||||
- 项目作者:ShaoHua
|
||||
- 项目地址:https://git.we965.cn/Tools/TodoList
|
||||
- 项目地址:https://git.we965.cn/Tools/Hua.Todo
|
||||
|
||||
---
|
||||
|
||||
**TodoList** - 跨平台任务管理,让效率无处不在!
|
||||
**Hua.Todo** - 跨平台任务管理,让效率无处不在!
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<Solution>
|
||||
<Configurations>
|
||||
<Platform Name="Any CPU" />
|
||||
<Platform Name="ARM64" />
|
||||
<Platform Name="x64" />
|
||||
<Platform Name="x86" />
|
||||
</Configurations>
|
||||
<Project Path="TodoList/TodoList.csproj" />
|
||||
<Project Path="src/TodoList.Application/TodoList.Application.csproj" />
|
||||
<Project Path="src/TodoList.Core/TodoList.Core.csproj" />
|
||||
<Project Path="src/TodoList.Host/TodoList.Host.csproj" />
|
||||
<Project Path="src/TodoList.Maui/TodoList.Maui.csproj" />
|
||||
</Solution>
|
||||
@@ -1,4 +1,4 @@
|
||||
# Android 端显示 “Not Found” 排查计划(TodoList.Maui)
|
||||
# Android 端显示 “Not Found” 排查计划(Hua.Todo.Maui)
|
||||
|
||||
## 目标
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
|
||||
## 背景(当前实现快速定位)
|
||||
|
||||
- Android 使用自建 TCP HTTP Server,静态资源从 APK 的 `Assets/wwwroot/*` 读取:[MobileEmbeddedWebServerService](file:///d:/Proj/TodoList/src/TodoList.Maui/Platforms/Android/MobileEmbeddedWebServerService.cs)
|
||||
- WebView 默认加载内嵌服务器地址(`IsUsingStatic=true` 时):[MainPage.xaml.cs](file:///d:/Proj/TodoList/src/TodoList.Maui/Views/MainPage.xaml.cs)
|
||||
- Android 端静态文件找不到时返回纯文本 `Not Found`:[HandleStaticAsync](file:///d:/Proj/TodoList/src/TodoList.Maui/Platforms/Android/MobileEmbeddedWebServerService.cs#L214-L255)
|
||||
- Android 使用自建 TCP HTTP Server,静态资源从 APK 的 `Assets/wwwroot/*` 读取:[MobileEmbeddedWebServerService](file:///d:/Proj/Hua.Todo/src/Hua.Todo.Maui/Platforms/Android/MobileEmbeddedWebServerService.cs)
|
||||
- WebView 默认加载内嵌服务器地址(`IsUsingStatic=true` 时):[MainPage.xaml.cs](file:///d:/Proj/Hua.Todo/src/Hua.Todo.Maui/Views/MainPage.xaml.cs)
|
||||
- Android 端静态文件找不到时返回纯文本 `Not Found`:[HandleStaticAsync](file:///d:/Proj/Hua.Todo/src/Hua.Todo.Maui/Platforms/Android/MobileEmbeddedWebServerService.cs#L214-L255)
|
||||
|
||||
## 排查顺序(从“最可能 & 最省时间”到“深入原因”)
|
||||
|
||||
### 1) 确认 WebView 实际加载的 URL
|
||||
|
||||
- 在 Android Debug 输出里确认 WebView Source(期望是 `http://localhost:5057` 或 `http://localhost:5057/`)
|
||||
- 如果不是内嵌地址,检查 `appsettings.json` 的 `WebServer.IsUsingStatic` 与 `ForEndUrl` 配置:[appsettings.json](file:///d:/Proj/TodoList/src/TodoList.Maui/appsettings.json)
|
||||
- 如果不是内嵌地址,检查 `appsettings.json` 的 `WebServer.IsUsingStatic` 与 `ForEndUrl` 配置:[appsettings.json](file:///d:/Proj/Hua.Todo/src/Hua.Todo.Maui/appsettings.json)
|
||||
|
||||
判定:
|
||||
- 若加载的是内嵌地址 → 继续第 2 步
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
### 2) 确认前端 dist 是否存在且可用于打包
|
||||
|
||||
- 检查 `src/TodoList.Web/dist/index.html` 是否存在
|
||||
- 如果不存在:在 `src/TodoList.Web` 下执行 `npm ci` + `npm run build`,确保产物生成
|
||||
- 检查 `src/Hua.Todo.Web/dist/index.html` 是否存在
|
||||
- 如果不存在:在 `src/Hua.Todo.Web` 下执行 `npm ci` + `npm run build`,确保产物生成
|
||||
|
||||
判定:
|
||||
- dist 不存在/为空 → “Not Found”高概率来自 Android 静态资源根本没被构建或没被打进 APK
|
||||
@@ -35,7 +35,7 @@
|
||||
- 重点验证打包结果是否存在:
|
||||
- `assets/wwwroot/index.html`
|
||||
- `assets/wwwroot/assets/*`(至少有 js/css)
|
||||
- 项目里通过 MSBuild 目标把 `TodoList.Web/dist` 映射为 AndroidAsset(Link 到 `wwwroot/...`):[TodoList.Maui.csproj](file:///d:/Proj/TodoList/src/TodoList.Maui/TodoList.Maui.csproj#L150-L175)
|
||||
- 项目里通过 MSBuild 目标把 `Hua.Todo.Web/dist` 映射为 AndroidAsset(Link 到 `wwwroot/...`):[Hua.Todo.Maui.csproj](file:///d:/Proj/Hua.Todo/src/Hua.Todo.Maui/Hua.Todo.Maui.csproj#L150-L175)
|
||||
|
||||
判定:
|
||||
- APK 内没有 `wwwroot/index.html` → 修复构建/打包流程(第 6 步会给方案)
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
- 如果看到的不是纯文本 `Not Found`,而是加载错误/空白:
|
||||
- 检查 Android 明文 HTTP(`http://localhost`)是否被允许
|
||||
- 检查 `network_security_config.xml` 与 Manifest 配置:[network_security_config.xml](file:///d:/Proj/TodoList/src/TodoList.Maui/Platforms/Android/Resources/xml/network_security_config.xml)、[AndroidManifest.xml](file:///d:/Proj/TodoList/src/TodoList.Maui/Platforms/Android/AndroidManifest.xml)
|
||||
- 检查 `network_security_config.xml` 与 Manifest 配置:[network_security_config.xml](file:///d:/Proj/Hua.Todo/src/Hua.Todo.Maui/Platforms/Android/Resources/xml/network_security_config.xml)、[AndroidManifest.xml](file:///d:/Proj/Hua.Todo/src/Hua.Todo.Maui/Platforms/Android/AndroidManifest.xml)
|
||||
|
||||
### 6) 修复与验证(根据前面判定选择)
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
- 让构建流程更“硬性”:
|
||||
- 若 dist 不存在则强制构建,或在 Debug 也保证 `AndroidAsset` 包含 dist
|
||||
- 可选:把 dist 复制进 `TodoList.Maui/wwwroot` 再用 `<Content Include="wwwroot\**" />`/`<MauiAsset />` 统一打包(减少条件目标的不确定性)
|
||||
- 可选:把 dist 复制进 `Hua.Todo.Maui/wwwroot` 再用 `<Content Include="wwwroot\**" />`/`<MauiAsset />` 统一打包(减少条件目标的不确定性)
|
||||
|
||||
验证:
|
||||
- APK 内能看到 `assets/wwwroot/index.html`,启动后不再返回 `Not Found`
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# TodoList 产品需求文档 (PRD) v1.1.0
|
||||
# Hua.Todo 产品需求文档 (PRD) v1.1.0
|
||||
|
||||
## 1. 项目概述
|
||||
本项目是一个基于 MAUI + WebView 架构开发的跨平台待办事项管理应用 (TodoList)。旨在提供轻量、高效的任务管理体验,特别是通过快捷键快速唤起记录功能,最大化用户的操作效率。v1.1.0 版本将实现跨平台支持,覆盖 Windows、macOS、Android、iOS 和 Linux(预览)平台。
|
||||
本项目是一个基于 MAUI + WebView 架构开发的跨平台代办管理应用 (Hua.Todo)。旨在提供轻量、高效的任务管理体验,特别是通过快捷键快速唤起记录功能,最大化用户的操作效率。v1.1.0 版本将实现跨平台支持,覆盖 Windows、macOS、Android、iOS 和 Linux(预览)平台。
|
||||
|
||||
## 2. 技术架构
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# TodoList 产品需求文档 (PRD)
|
||||
# Hua.Todo 产品需求文档 (PRD)
|
||||
|
||||
## 1. 项目概述
|
||||
本项目是一个基于 C# WPF (.NET 10) 开发的桌面待办事项管理应用 (TodoList)。旨在提供轻量、高效的任务管理体验,特别是通过快捷键快速唤起记录功能,最大化用户的操作效率。
|
||||
本项目是一个基于 C# WPF (.NET 10) 开发的桌面代办管理应用 (Hua.Todo)。旨在提供轻量、高效的任务管理体验,特别是通过快捷键快速唤起记录功能,最大化用户的操作效率。
|
||||
|
||||
## 2. 技术架构
|
||||
- **开发语言**: C#
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# TodoList 代码规范文档 v1.1.0
|
||||
# Hua.Todo 代码规范文档 v1.1.0
|
||||
|
||||
## 1. 概述
|
||||
本文档定义 TodoList 项目的代码规范,包括 C#、JavaScript/TypeScript、Vue.js 和其他相关技术的编码标准。遵循这些规范有助于提高代码质量、可读性和可维护性。
|
||||
本文档定义 Hua.Todo 项目的代码规范,包括 C#、JavaScript/TypeScript、Vue.js 和其他相关技术的编码标准。遵循这些规范有助于提高代码质量、可读性和可维护性。
|
||||
|
||||
## 2. 通用规范
|
||||
|
||||
@@ -80,7 +80,7 @@ using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// 2. 命名空间
|
||||
namespace TodoList.Api.Services;
|
||||
namespace Hua.Todo.Api.Services;
|
||||
|
||||
// 3. XML 文档注释
|
||||
/// <summary>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# TodoList 实现对比文档
|
||||
# Hua.Todo 实现对比文档
|
||||
|
||||
## 项目概述
|
||||
本项目是一个基于 MAUI + WebView 架构开发的跨平台待办事项管理应用。
|
||||
本项目是一个基于 MAUI + WebView 架构开发的跨平台代办管理应用。
|
||||
|
||||
## 实现进度
|
||||
|
||||
@@ -182,9 +182,9 @@
|
||||
## 当前运行状态
|
||||
|
||||
### 服务状态
|
||||
- ✅ **TodoList.Api**: 运行中 (http://localhost:5173)
|
||||
- ✅ **TodoList.Web**: 运行中 (http://localhost:5173)
|
||||
- ✅ **TodoList.Maui**: 运行中 (Windows 桌面应用)
|
||||
- ✅ **Hua.Todo.Api**: 运行中 (http://localhost:5173)
|
||||
- ✅ **Hua.Todo.Web**: 运行中 (http://localhost:5173)
|
||||
- ✅ **Hua.Todo.Maui**: 运行中 (Windows 桌面应用)
|
||||
|
||||
### 修复的 Bug
|
||||
- ✅ 修复了 QuickEntryPage.xaml.cs 中的插值字符串转义问题
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# TodoList 技术设计文档 v1.1.0
|
||||
# Hua.Todo 技术设计文档 v1.1.0
|
||||
|
||||
## 1. 项目概述
|
||||
本文档描述 TodoList v1.1.0 的技术设计方案,包括项目文件目录结构、模块划分、技术选型和实现细节。
|
||||
本文档描述 Hua.Todo v1.1.0 的技术设计方案,包括项目文件目录结构、模块划分、技术选型和实现细节。
|
||||
|
||||
## 2. 技术栈
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
## 3. 项目目录结构
|
||||
|
||||
```
|
||||
TodoList/
|
||||
Hua.Todo/
|
||||
├── docs/ # 文档目录
|
||||
│ ├── PRD.md # 产品需求文档
|
||||
│ ├── PRD-1.1.0.md # v1.1.0 产品需求文档
|
||||
@@ -36,7 +36,7 @@ TodoList/
|
||||
│ └── CodeStandards.md # 代码规范文档
|
||||
│
|
||||
├── src/ # 源代码目录
|
||||
│ ├── TodoList.Maui/ # MAUI 主项目(跨平台入口)
|
||||
│ ├── Hua.Todo.Maui/ # MAUI 主项目(跨平台入口)
|
||||
│ │ ├── Platforms/ # 平台特定代码
|
||||
│ │ │ ├── Windows/ # Windows 平台代码
|
||||
│ │ │ │ ├── App.xaml # Windows 应用入口
|
||||
@@ -67,9 +67,9 @@ TodoList/
|
||||
│ │ ├── App.xaml # MAUI 应用入口
|
||||
│ │ ├── App.xaml.cs
|
||||
│ │ ├── MauiProgram.cs # MAUI 程序配置
|
||||
│ │ └── TodoList.Maui.csproj # MAUI 项目文件
|
||||
│ │ └── Hua.Todo.Maui.csproj # MAUI 项目文件
|
||||
│ │
|
||||
│ ├── TodoList.Api/ # 后端 API 项目
|
||||
│ ├── Hua.Todo.Api/ # 后端 API 项目
|
||||
│ │ ├── Controllers/ # API 控制器
|
||||
│ │ │ ├── TasksController.cs
|
||||
│ │ │ ├── SettingsController.cs
|
||||
@@ -95,9 +95,9 @@ TodoList/
|
||||
│ │ │ └── ServiceCollectionExtensions.cs
|
||||
│ │ ├── Program.cs # API 入口
|
||||
│ │ ├── appsettings.json # 配置文件
|
||||
│ │ └── TodoList.Api.csproj # API 项目文件
|
||||
│ │ └── Hua.Todo.Api.csproj # API 项目文件
|
||||
│ │
|
||||
│ ├── TodoList.Core/ # 核心业务逻辑层
|
||||
│ ├── Hua.Todo.Core/ # 核心业务逻辑层
|
||||
│ │ ├── Entities/ # 实体类
|
||||
│ │ │ ├── Task.cs
|
||||
│ │ │ └── TaskPriority.cs
|
||||
@@ -108,9 +108,9 @@ TodoList/
|
||||
│ │ │ └── TaskTitle.cs
|
||||
│ │ ├── Specifications/ # 规范模式
|
||||
│ │ │ └── TaskSpecifications.cs
|
||||
│ │ └── TodoList.Core.csproj # Core 项目文件
|
||||
│ │ └── Hua.Todo.Core.csproj # Core 项目文件
|
||||
│ │
|
||||
│ ├── TodoList.Web/ # 前端 Web 项目 (Vue.js)
|
||||
│ ├── Hua.Todo.Web/ # 前端 Web 项目 (Vue.js)
|
||||
│ │ ├── public/ # 静态资源
|
||||
│ │ │ └── index.html
|
||||
│ │ ├── src/ # 源代码
|
||||
@@ -145,7 +145,7 @@ TodoList/
|
||||
│ │ ├── tsconfig.json # TypeScript 配置
|
||||
│ │ └── index.html # HTML 模板
|
||||
│ │
|
||||
│ └── TodoList.Tests/ # 测试项目
|
||||
│ └── Hua.Todo.Tests/ # 测试项目
|
||||
│ ├── Unit/ # 单元测试
|
||||
│ │ ├── Services/
|
||||
│ │ │ └── TaskServiceTests.cs
|
||||
@@ -153,16 +153,16 @@ TodoList/
|
||||
│ │ └── TasksControllerTests.cs
|
||||
│ ├── Integration/ # 集成测试
|
||||
│ │ └── ApiIntegrationTests.cs
|
||||
│ └── TodoList.Tests.csproj
|
||||
│ └── Hua.Todo.Tests.csproj
|
||||
│
|
||||
├── .gitignore # Git 忽略文件
|
||||
├── TodoList.sln # 解决方案文件
|
||||
├── Hua.Todo.sln # 解决方案文件
|
||||
└── README.md # 项目说明文档
|
||||
```
|
||||
|
||||
## 4. 模块设计
|
||||
|
||||
### 4.1 MAUI 主项目 (TodoList.Maui)
|
||||
### 4.1 MAUI 主项目 (Hua.Todo.Maui)
|
||||
**职责**:
|
||||
- 应用程序入口和生命周期管理
|
||||
- 平台特定功能封装
|
||||
@@ -175,7 +175,7 @@ TodoList/
|
||||
- `WebViewContainer`: 封装 WebView 控件
|
||||
- 平台特定服务: 快捷键、通知等
|
||||
|
||||
### 4.2 后端 API 项目 (TodoList.Api)
|
||||
### 4.2 后端 API 项目 (Hua.Todo.Api)
|
||||
**职责**:
|
||||
- 提供 RESTful API 接口
|
||||
- 业务逻辑处理
|
||||
@@ -188,7 +188,7 @@ TodoList/
|
||||
- `Data`: 数据访问层和数据库上下文
|
||||
- `Program.cs`: API 服务器配置和启动
|
||||
|
||||
### 4.3 核心业务层 (TodoList.Core)
|
||||
### 4.3 核心业务层 (Hua.Todo.Core)
|
||||
**职责**:
|
||||
- 定义领域模型和业务规则
|
||||
- 提供核心业务接口
|
||||
@@ -200,7 +200,7 @@ TodoList/
|
||||
- `ValueObjects`: 值对象
|
||||
- `Specifications`: 业务规范
|
||||
|
||||
### 4.4 前端 Web 项目 (TodoList.Web)
|
||||
### 4.4 前端 Web 项目 (Hua.Todo.Web)
|
||||
**职责**:
|
||||
- 用户界面展示
|
||||
- 用户交互处理
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$ScriptPath = $PSScriptRoot
|
||||
$ProjectDir = Join-Path $ScriptPath "src\TodoList.Maui"
|
||||
$ProjectFile = Join-Path $ProjectDir "TodoList.Maui.csproj"
|
||||
$ProjectDir = Join-Path $ScriptPath "src\Hua.Todo.Maui"
|
||||
$ProjectFile = Join-Path $ProjectDir "Hua.Todo.Maui.csproj"
|
||||
$SetupScript = Join-Path $ProjectDir "setup.iss"
|
||||
|
||||
# Read version from project file
|
||||
@@ -34,7 +34,7 @@ if (Test-Path $SetupScript) {
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Building TodoList.Maui (Release)..." -ForegroundColor Cyan
|
||||
Write-Host "Building Hua.Todo.Maui (Release)..." -ForegroundColor Cyan
|
||||
dotnet publish $ProjectFile -f net10.0-windows10.0.19041.0 -c Release --self-contained false
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "MAUI build failed"
|
||||
|
||||
@@ -5,18 +5,18 @@ param(
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
Write-Host "====================================" -ForegroundColor Cyan
|
||||
Write-Host " TodoList.Web Restart Script" -ForegroundColor Cyan
|
||||
Write-Host " Hua.Todo.Web Restart Script" -ForegroundColor Cyan
|
||||
Write-Host "====================================" -ForegroundColor Cyan
|
||||
Write-Host ""
|
||||
|
||||
$webProjectPath = Join-Path $PSScriptRoot "src\TodoList.Web"
|
||||
$webProjectPath = Join-Path $PSScriptRoot "src\Hua.Todo.Web"
|
||||
|
||||
if (!(Test-Path $webProjectPath)) {
|
||||
Write-Host "ERROR: Web project path not found: $webProjectPath" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
function Get-TodoListWebProcesses {
|
||||
function Get-Hua.TodoWebProcesses {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$WebProjectPath
|
||||
@@ -31,10 +31,10 @@ function Get-TodoListWebProcesses {
|
||||
|
||||
Write-Host "[1/3] Stopping existing service..." -ForegroundColor Yellow
|
||||
|
||||
$webProcesses = @(Get-TodoListWebProcesses -WebProjectPath $webProjectPath)
|
||||
$webProcesses = @(Get-Hua.TodoWebProcesses -WebProjectPath $webProjectPath)
|
||||
|
||||
if ($webProcesses.Count -eq 0) {
|
||||
Write-Host "OK: TodoList.Web is not running" -ForegroundColor Green
|
||||
Write-Host "OK: Hua.Todo.Web is not running" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host "Found $($webProcesses.Count) process(es)" -ForegroundColor Yellow
|
||||
foreach ($process in $webProcesses) {
|
||||
@@ -56,7 +56,7 @@ $timeout = 10
|
||||
$elapsed = 0
|
||||
|
||||
while ($elapsed -lt $timeout) {
|
||||
$webRunning = @(Get-TodoListWebProcesses -WebProjectPath $webProjectPath)
|
||||
$webRunning = @(Get-Hua.TodoWebProcesses -WebProjectPath $webProjectPath)
|
||||
|
||||
if ($webRunning.Count -eq 0) {
|
||||
Write-Host "OK: All processes exited" -ForegroundColor Green
|
||||
@@ -84,7 +84,7 @@ try {
|
||||
|
||||
$webProcess = Start-Process -FilePath "npm.cmd" -ArgumentList @("run", "dev") -WorkingDirectory $webProjectPath -PassThru
|
||||
|
||||
Write-Host "OK: Started TodoList.Web" -ForegroundColor Green
|
||||
Write-Host "OK: Started Hua.Todo.Web" -ForegroundColor Green
|
||||
Write-Host "PID: $($webProcess.Id)" -ForegroundColor Gray
|
||||
} catch {
|
||||
Write-Host "ERROR: Failed to start service. $_" -ForegroundColor Red
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using TodoList.Core.Entities;
|
||||
using Hua.Todo.Core.Entities;
|
||||
|
||||
namespace TodoList.Application.Data;
|
||||
namespace Hua.Todo.Application.Data;
|
||||
|
||||
public class TodoDbContext : DbContext
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
|
||||
namespace TodoList.Application.DynamicApi;
|
||||
namespace Hua.Todo.Application.DynamicApi;
|
||||
|
||||
public static class DynamicApiExtensions
|
||||
{
|
||||
@@ -2,9 +2,9 @@ using System.Reflection;
|
||||
using System.Text.Json;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using TodoList.Application.Interfaces;
|
||||
using Hua.Todo.Application.Interfaces;
|
||||
|
||||
namespace TodoList.Application.DynamicApi;
|
||||
namespace Hua.Todo.Application.DynamicApi;
|
||||
|
||||
public class DynamicApiMiddleware
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TodoList.Application.DynamicApi;
|
||||
namespace Hua.Todo.Application.DynamicApi;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
|
||||
public class HttpGetAttribute : Attribute
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TodoList.Application.DynamicApi;
|
||||
namespace Hua.Todo.Application.DynamicApi;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
|
||||
public class FromQueryAttribute : Attribute
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TodoList.Application.DynamicApi;
|
||||
namespace Hua.Todo.Application.DynamicApi;
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Method, AllowMultiple = false)]
|
||||
public class RemoteServiceAttribute : Attribute
|
||||
@@ -20,7 +20,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TodoList.Core\TodoList.Core.csproj" />
|
||||
<ProjectReference Include="..\Hua.Todo.Core\Hua.Todo.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace Hua.Todo.Application.Interfaces;
|
||||
|
||||
public interface IDynamicApiService
|
||||
{
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using TodoList.Application.Models;
|
||||
using Hua.Todo.Application.Models;
|
||||
|
||||
namespace TodoList.Application.Interfaces;
|
||||
namespace Hua.Todo.Application.Interfaces;
|
||||
|
||||
public interface ITaskService : IDynamicApiService
|
||||
{
|
||||
@@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TodoList.Application.Data;
|
||||
using Hua.Todo.Application.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TodoList.Application.Migrations
|
||||
namespace Hua.Todo.Application.Migrations
|
||||
{
|
||||
[DbContext(typeof(TodoDbContext))]
|
||||
[Migration("20260313044926_InitialCreate")]
|
||||
@@ -20,7 +20,7 @@ namespace TodoList.Application.Migrations
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "10.0.5");
|
||||
|
||||
modelBuilder.Entity("TodoList.Core.Entities.TaskEntity", b =>
|
||||
modelBuilder.Entity("Hua.Todo.Core.Entities.TaskEntity", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TodoList.Application.Migrations
|
||||
namespace Hua.Todo.Application.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class InitialCreate : Migration
|
||||
@@ -4,11 +4,11 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TodoList.Application.Data;
|
||||
using Hua.Todo.Application.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TodoList.Application.Migrations
|
||||
namespace Hua.Todo.Application.Migrations
|
||||
{
|
||||
[DbContext(typeof(TodoDbContext))]
|
||||
[Migration("20260313092658_AddParentTaskId")]
|
||||
@@ -20,7 +20,7 @@ namespace TodoList.Application.Migrations
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "10.0.5");
|
||||
|
||||
modelBuilder.Entity("TodoList.Core.Entities.TaskEntity", b =>
|
||||
modelBuilder.Entity("Hua.Todo.Core.Entities.TaskEntity", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -61,9 +61,9 @@ namespace TodoList.Application.Migrations
|
||||
b.ToTable("Tasks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoList.Core.Entities.TaskEntity", b =>
|
||||
modelBuilder.Entity("Hua.Todo.Core.Entities.TaskEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoList.Core.Entities.TaskEntity", "ParentTask")
|
||||
b.HasOne("Hua.Todo.Core.Entities.TaskEntity", "ParentTask")
|
||||
.WithMany("SubTasks")
|
||||
.HasForeignKey("ParentTaskId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
@@ -71,7 +71,7 @@ namespace TodoList.Application.Migrations
|
||||
b.Navigation("ParentTask");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoList.Core.Entities.TaskEntity", b =>
|
||||
modelBuilder.Entity("Hua.Todo.Core.Entities.TaskEntity", b =>
|
||||
{
|
||||
b.Navigation("SubTasks");
|
||||
});
|
||||
@@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TodoList.Application.Migrations
|
||||
namespace Hua.Todo.Application.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddParentTaskId : Migration
|
||||
@@ -3,11 +3,11 @@ using System;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using TodoList.Application.Data;
|
||||
using Hua.Todo.Application.Data;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace TodoList.Application.Migrations
|
||||
namespace Hua.Todo.Application.Migrations
|
||||
{
|
||||
[DbContext(typeof(TodoDbContext))]
|
||||
partial class TodoDbContextModelSnapshot : ModelSnapshot
|
||||
@@ -17,7 +17,7 @@ namespace TodoList.Application.Migrations
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder.HasAnnotation("ProductVersion", "10.0.5");
|
||||
|
||||
modelBuilder.Entity("TodoList.Core.Entities.TaskEntity", b =>
|
||||
modelBuilder.Entity("Hua.Todo.Core.Entities.TaskEntity", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
@@ -58,9 +58,9 @@ namespace TodoList.Application.Migrations
|
||||
b.ToTable("Tasks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoList.Core.Entities.TaskEntity", b =>
|
||||
modelBuilder.Entity("Hua.Todo.Core.Entities.TaskEntity", b =>
|
||||
{
|
||||
b.HasOne("TodoList.Core.Entities.TaskEntity", "ParentTask")
|
||||
b.HasOne("Hua.Todo.Core.Entities.TaskEntity", "ParentTask")
|
||||
.WithMany("SubTasks")
|
||||
.HasForeignKey("ParentTaskId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
@@ -68,7 +68,7 @@ namespace TodoList.Application.Migrations
|
||||
b.Navigation("ParentTask");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("TodoList.Core.Entities.TaskEntity", b =>
|
||||
modelBuilder.Entity("Hua.Todo.Core.Entities.TaskEntity", b =>
|
||||
{
|
||||
b.Navigation("SubTasks");
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
using TodoList.Core.Entities;
|
||||
using Hua.Todo.Core.Entities;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace TodoList.Application.Models;
|
||||
namespace Hua.Todo.Application.Models;
|
||||
|
||||
public class CreateTaskDto
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"profiles": {
|
||||
"TodoList.Application": {
|
||||
"Hua.Todo.Application": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
@@ -1,9 +1,9 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using TodoList.Application.Data;
|
||||
using TodoList.Core.Entities;
|
||||
using TodoList.Core.Interfaces;
|
||||
using Hua.Todo.Application.Data;
|
||||
using Hua.Todo.Core.Entities;
|
||||
using Hua.Todo.Core.Interfaces;
|
||||
|
||||
namespace TodoList.Application.Repositories;
|
||||
namespace Hua.Todo.Application.Repositories;
|
||||
|
||||
public class TaskRepository : ITaskRepository
|
||||
{
|
||||
@@ -1,20 +1,20 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using TodoList.Application.Data;
|
||||
using TodoList.Application.Interfaces;
|
||||
using TodoList.Application.Repositories;
|
||||
using TodoList.Application.Services;
|
||||
using TodoList.Core.Interfaces;
|
||||
using ITaskService = TodoList.Application.Interfaces.ITaskService;
|
||||
using Hua.Todo.Application.Data;
|
||||
using Hua.Todo.Application.Interfaces;
|
||||
using Hua.Todo.Application.Repositories;
|
||||
using Hua.Todo.Application.Services;
|
||||
using Hua.Todo.Core.Interfaces;
|
||||
using ITaskService = Hua.Todo.Application.Interfaces.ITaskService;
|
||||
|
||||
namespace TodoList.Application;
|
||||
namespace Hua.Todo.Application;
|
||||
|
||||
public static class ServiceCollectionExtensions
|
||||
{
|
||||
public static IServiceCollection AddApplicationServices(this IServiceCollection services, string connectionString)
|
||||
{
|
||||
services.AddDbContext<TodoDbContext>(options =>
|
||||
options.UseSqlite(connectionString, b => b.MigrationsAssembly("TodoList.Application")));
|
||||
options.UseSqlite(connectionString, b => b.MigrationsAssembly("Hua.Todo.Application")));
|
||||
services.AddScoped<ITaskRepository, TaskRepository>();
|
||||
services.AddScoped<ITaskService, TaskService>();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using TodoList.Application.Interfaces;
|
||||
using TodoList.Application.Models;
|
||||
using TodoList.Core.Entities;
|
||||
using TodoList.Core.Interfaces;
|
||||
using Hua.Todo.Application.Interfaces;
|
||||
using Hua.Todo.Application.Models;
|
||||
using Hua.Todo.Core.Entities;
|
||||
using Hua.Todo.Core.Interfaces;
|
||||
|
||||
namespace TodoList.Application.Services;
|
||||
namespace Hua.Todo.Application.Services;
|
||||
|
||||
public class TaskService : ITaskService
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace TodoList.Core.Entities;
|
||||
namespace Hua.Todo.Core.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 任务实体类,表示一个待办事项
|
||||
/// 任务实体类,表示一个代办
|
||||
/// </summary>
|
||||
public class TaskEntity
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TodoList.Core.Entities;
|
||||
namespace Hua.Todo.Core.Entities;
|
||||
|
||||
/// <summary>
|
||||
/// 任务优先级枚举,定义任务的三种优先级级别
|
||||
@@ -1,6 +1,6 @@
|
||||
using TodoList.Core.Entities;
|
||||
using Hua.Todo.Core.Entities;
|
||||
|
||||
namespace TodoList.Core.Interfaces;
|
||||
namespace Hua.Todo.Core.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// 任务仓储接口,定义任务数据访问操作
|
||||
@@ -15,7 +15,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TodoList.Application\TodoList.Application.csproj" />
|
||||
<ProjectReference Include="..\Hua.Todo.Application\Hua.Todo.Application.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Text.Json;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using TodoList.Application;
|
||||
using TodoList.Application.DynamicApi;
|
||||
using TodoList.Application.Interfaces;
|
||||
using TodoList.Application.Models;
|
||||
using Hua.Todo.Application;
|
||||
using Hua.Todo.Application.DynamicApi;
|
||||
using Hua.Todo.Application.Interfaces;
|
||||
using Hua.Todo.Application.Models;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
@@ -11,7 +11,7 @@ builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
builder.Services.AddAuthorization();
|
||||
|
||||
builder.Services.AddApplicationServices("Data Source=todolist.db");
|
||||
builder.Services.AddApplicationServices("Data Source=Hua.Todo.db");
|
||||
|
||||
builder.Services.AddCors(options =>
|
||||
{
|
||||
@@ -28,7 +28,7 @@ var app = builder.Build();
|
||||
// Apply database migrations
|
||||
using (var scope = app.Services.CreateScope())
|
||||
{
|
||||
var dbContext = scope.ServiceProvider.GetRequiredService<TodoList.Application.Data.TodoDbContext>();
|
||||
var dbContext = scope.ServiceProvider.GetRequiredService<Hua.Todo.Application.Data.TodoDbContext>();
|
||||
dbContext.Database.Migrate();
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version = "1.0" encoding = "UTF-8" ?>
|
||||
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:TodoList.Maui"
|
||||
x:Class="TodoList.Maui.App">
|
||||
xmlns:local="clr-namespace:Hua.Todo.Maui"
|
||||
x:Class="Hua.Todo.Maui.App">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
@@ -1,9 +1,9 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.IO;
|
||||
using TodoList.Maui.Services;
|
||||
using TodoList.Maui.Views;
|
||||
using TodoList.Maui.Models;
|
||||
using Hua.Todo.Maui.Services;
|
||||
using Hua.Todo.Maui.Views;
|
||||
using Hua.Todo.Maui.Models;
|
||||
#if WINDOWS
|
||||
using System.Runtime.InteropServices;
|
||||
using Windowing = Microsoft.UI.Windowing;
|
||||
@@ -11,7 +11,7 @@ using WinUiWindow = Microsoft.UI.Xaml.Window;
|
||||
using WinRT.Interop;
|
||||
#endif
|
||||
|
||||
namespace TodoList.Maui;
|
||||
namespace Hua.Todo.Maui;
|
||||
|
||||
public partial class App : global::Microsoft.Maui.Controls.Application
|
||||
{
|
||||
@@ -70,7 +70,7 @@ protected override Microsoft.Maui.Controls.Window CreateWindow(IActivationState?
|
||||
platformWindow.AppWindow.Closing += (sender, args) =>
|
||||
{
|
||||
args.Cancel = true;
|
||||
new TodoList.Maui.Platforms.Windows.WindowsWindowService().HideWindow(_mainWindow);
|
||||
new Hua.Todo.Maui.Platforms.Windows.WindowsWindowService().HideWindow(_mainWindow);
|
||||
};
|
||||
|
||||
CenterMainWindow(platformWindow);
|
||||
@@ -88,7 +88,7 @@ protected override Microsoft.Maui.Controls.Window CreateWindow(IActivationState?
|
||||
if (_mainWindow == null) return;
|
||||
|
||||
#if WINDOWS
|
||||
if (_mainWindow.Handler?.PlatformView is not Window)
|
||||
if (_mainWindow.Handler?.PlatformView is not WinUiWindow)
|
||||
{
|
||||
if (attempt < 30)
|
||||
{
|
||||
@@ -118,7 +118,7 @@ protected override Microsoft.Maui.Controls.Window CreateWindow(IActivationState?
|
||||
#if WINDOWS
|
||||
if (_mainWindow.Handler != null)
|
||||
{
|
||||
new TodoList.Maui.Platforms.Windows.WindowsWindowService().RestoreWindow(_mainWindow);
|
||||
new Hua.Todo.Maui.Platforms.Windows.WindowsWindowService().RestoreWindow(_mainWindow);
|
||||
var platformWindow = _mainWindow.Handler.PlatformView as WinUiWindow;
|
||||
platformWindow?.Activate();
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<Shell
|
||||
x:Class="TodoList.Maui.AppShell"
|
||||
x:Class="Hua.Todo.Maui.AppShell"
|
||||
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||
xmlns:local="clr-namespace:TodoList.Maui"
|
||||
xmlns:views="clr-namespace:TodoList.Maui.Views"
|
||||
Title="TodoList.Maui">
|
||||
xmlns:local="clr-namespace:Hua.Todo.Maui"
|
||||
xmlns:views="clr-namespace:Hua.Todo.Maui.Views"
|
||||
Title="Hua.Todo.Maui">
|
||||
|
||||
<ShellContent
|
||||
Title="Home"
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TodoList.Maui;
|
||||
namespace Hua.Todo.Maui;
|
||||
|
||||
public partial class AppShell : Shell
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using Microsoft.Maui.Controls;
|
||||
using System.Globalization;
|
||||
|
||||
namespace TodoList.Maui.Converters
|
||||
namespace Hua.Todo.Maui.Converters
|
||||
{
|
||||
public class PriorityToColorConverter : IValueConverter
|
||||
{
|
||||
@@ -12,21 +12,21 @@
|
||||
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->
|
||||
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>TodoList.Maui</RootNamespace>
|
||||
<RootNamespace>Hua.Todo.Maui</RootNamespace>
|
||||
<UseMaui>true</UseMaui>
|
||||
<SingleProject>true</SingleProject>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<CodePage>65001</CodePage>
|
||||
|
||||
<!-- Android SDK Path -->
|
||||
<AndroidSdkDirectory>C:\Users\ShaoHua\AppData\Local\Android\Sdk</AndroidSdkDirectory>
|
||||
<!-- Android SDK Path - Fallback for local development -->
|
||||
<AndroidSdkDirectory Condition="'$(AndroidSdkDirectory)' == '' and Exists('$(USERPROFILE)\AppData\Local\Android\Sdk')">$(USERPROFILE)\AppData\Local\Android\Sdk</AndroidSdkDirectory>
|
||||
|
||||
<!-- Display name -->
|
||||
<ApplicationTitle>待办事项</ApplicationTitle>
|
||||
<ApplicationTitle>代办</ApplicationTitle>
|
||||
|
||||
<!-- App Identifier -->
|
||||
<ApplicationId>com.companyname.todolist.maui</ApplicationId>
|
||||
<ApplicationId>com.companyname.Hua.Todo.maui</ApplicationId>
|
||||
|
||||
<!-- Versions -->
|
||||
<Version>1.1.5</Version>
|
||||
@@ -34,9 +34,9 @@
|
||||
<ApplicationVersion>1</ApplicationVersion>
|
||||
|
||||
<!-- Assembly Info -->
|
||||
<AssemblyTitle>待办事项</AssemblyTitle>
|
||||
<AssemblyProduct>待办事项</AssemblyProduct>
|
||||
<AssemblyCompany>TodoList</AssemblyCompany>
|
||||
<AssemblyTitle>待办</AssemblyTitle>
|
||||
<AssemblyProduct>待办</AssemblyProduct>
|
||||
<AssemblyCompany>Hua.Todo</AssemblyCompany>
|
||||
<AssemblyCopyright>Copyright 2024</AssemblyCopyright>
|
||||
|
||||
<!-- To develop, package, and publish an app to the Microsoft Store, see: https://aka.ms/MauiTemplateUnpackaged -->
|
||||
@@ -48,8 +48,8 @@
|
||||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
|
||||
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
|
||||
|
||||
<TodoListWebDir>$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)/../TodoList.Web'))</TodoListWebDir>
|
||||
<TodoListWebDistDir>$(TodoListWebDir)\dist</TodoListWebDistDir>
|
||||
<TodoWebDir>$([System.IO.Path]::GetFullPath('$(MSBuildProjectDirectory)/../Hua.Todo.Web'))</TodoWebDir>
|
||||
<TodoWebDistDir>$(TodoWebDir)\dist</TodoWebDistDir>
|
||||
<SkipWebBuild>false</SkipWebBuild>
|
||||
<ForceWebBuild>false</ForceWebBuild>
|
||||
</PropertyGroup>
|
||||
@@ -115,7 +115,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\TodoList.Application\TodoList.Application.csproj" />
|
||||
<ProjectReference Include="..\Hua.Todo.Application\Hua.Todo.Application.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -146,52 +146,38 @@
|
||||
<Folder Include="wwwroot\" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="BuildTodoListWeb"
|
||||
BeforeTargets="UpdateAndroidAssets;BeforeBuild"
|
||||
Condition="'$(SkipWebBuild)' != 'true' And Exists('$(TodoListWebDir)') And ('$(ForceWebBuild)' == 'true' Or !Exists('$(TodoListWebDistDir)\index.html'))">
|
||||
<Exec Command="npm ci" WorkingDirectory="$(TodoListWebDir)"
|
||||
Condition="Exists('$(TodoListWebDir)\package-lock.json') And !Exists('$(TodoListWebDir)\node_modules')" />
|
||||
<Exec Command="npm install" WorkingDirectory="$(TodoListWebDir)"
|
||||
Condition="!Exists('$(TodoListWebDir)\package-lock.json') And !Exists('$(TodoListWebDir)\node_modules')" />
|
||||
<Exec Command="npm run build" WorkingDirectory="$(TodoListWebDir)" />
|
||||
<Target Name="BuildTodoWeb" BeforeTargets="UpdateAndroidAssets;BeforeBuild" Condition="'$(SkipWebBuild)' != 'true' And Exists('$(TodoWebDir)') And ('$(ForceWebBuild)' == 'true' Or !Exists('$(TodoWebDistDir)\index.html'))">
|
||||
<Exec Command="npm ci" WorkingDirectory="$(TodoWebDir)" Condition="Exists('$(TodoWebDir)\package-lock.json') And !Exists('$(TodoWebDir)\node_modules')" />
|
||||
<Exec Command="npm install" WorkingDirectory="$(TodoWebDir)" Condition="!Exists('$(TodoWebDir)\package-lock.json') And !Exists('$(TodoWebDir)\node_modules')" />
|
||||
<Exec Command="npm run build" WorkingDirectory="$(TodoWebDir)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="SyncTodoListWebDistToMauiWwwroot"
|
||||
BeforeTargets="ProcessMauiAssets"
|
||||
DependsOnTargets="BuildTodoListWeb"
|
||||
Condition="'$(TargetFramework)' == 'net10.0-android' And Exists('$(TodoListWebDistDir)\index.html')">
|
||||
<Target Name="SyncTodoWebDistToMauiWwwroot" BeforeTargets="ProcessMauiAssets" DependsOnTargets="BuildTodoWeb" Condition="'$(TargetFramework)' == 'net10.0-android' And Exists('$(TodoWebDistDir)\index.html')">
|
||||
<ItemGroup>
|
||||
<_TodoListWebDistFiles Include="$(TodoListWebDistDir)\**\*" />
|
||||
<_TodoWebDistFiles Include="$(TodoWebDistDir)\**\*" />
|
||||
</ItemGroup>
|
||||
|
||||
<RemoveDir Directories="$(MSBuildProjectDirectory)\wwwroot" Condition="Exists('$(MSBuildProjectDirectory)\wwwroot')" />
|
||||
<MakeDir Directories="$(MSBuildProjectDirectory)\wwwroot" />
|
||||
|
||||
<Copy SourceFiles="@(_TodoListWebDistFiles)"
|
||||
DestinationFiles="@(_TodoListWebDistFiles->'$(MSBuildProjectDirectory)\wwwroot\%(RecursiveDir)%(Filename)%(Extension)')"
|
||||
SkipUnchangedFiles="true" />
|
||||
<Copy SourceFiles="@(_TodoWebDistFiles)" DestinationFiles="@(_TodoWebDistFiles->'$(MSBuildProjectDirectory)\wwwroot\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
|
||||
|
||||
<ItemGroup>
|
||||
<MauiAsset Include="@(_TodoListWebDistFiles)">
|
||||
<MauiAsset Include="@(_TodoWebDistFiles)">
|
||||
<LogicalName>wwwroot/%(RecursiveDir)%(Filename)%(Extension)</LogicalName>
|
||||
</MauiAsset>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="CopyTodoListWebDistToWindowsWwwroot"
|
||||
BeforeTargets="Build"
|
||||
DependsOnTargets="BuildTodoListWeb"
|
||||
Condition="'$(TargetFramework)' == 'net10.0-windows10.0.19041.0' And Exists('$(TodoListWebDistDir)')">
|
||||
<Target Name="CopyTodoWebDistToWindowsWwwroot" BeforeTargets="Build" DependsOnTargets="BuildTodoWeb" Condition="'$(TargetFramework)' == 'net10.0-windows10.0.19041.0' And Exists('$(TodoWebDistDir)')">
|
||||
<ItemGroup>
|
||||
<_TodoListWebDistFiles Include="$(TodoListWebDistDir)\**\*" />
|
||||
<_TodoWebDistFiles Include="$(TodoWebDistDir)\**\*" />
|
||||
</ItemGroup>
|
||||
|
||||
<RemoveDir Directories="$(TargetDir)wwwroot" Condition="Exists('$(TargetDir)wwwroot')" />
|
||||
<MakeDir Directories="$(TargetDir)wwwroot" />
|
||||
|
||||
<Copy SourceFiles="@(_TodoListWebDistFiles)"
|
||||
DestinationFiles="@(_TodoListWebDistFiles->'$(TargetDir)wwwroot\%(RecursiveDir)%(Filename)%(Extension)')"
|
||||
SkipUnchangedFiles="true" />
|
||||
<Copy SourceFiles="@(_TodoWebDistFiles)" DestinationFiles="@(_TodoWebDistFiles->'$(TargetDir)wwwroot\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
||||
@@ -2,13 +2,13 @@ using System.Text.Json;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Data.Sqlite;
|
||||
using TodoList.Application;
|
||||
using TodoList.Application.Data;
|
||||
using TodoList.Maui.Models;
|
||||
using TodoList.Maui.Services;
|
||||
using TodoList.Maui.Services.Platforms;
|
||||
using Hua.Todo.Application;
|
||||
using Hua.Todo.Application.Data;
|
||||
using Hua.Todo.Maui.Models;
|
||||
using Hua.Todo.Maui.Services;
|
||||
using Hua.Todo.Maui.Services.Platforms;
|
||||
|
||||
namespace TodoList.Maui;
|
||||
namespace Hua.Todo.Maui;
|
||||
|
||||
public static class MauiProgram
|
||||
{
|
||||
@@ -28,8 +28,14 @@ public static class MauiProgram
|
||||
// Set default connection string if not provided
|
||||
if (string.IsNullOrEmpty(appSettings.WebServer.ConnectionString))
|
||||
{
|
||||
var dbPath = Path.Combine(FileSystem.AppDataDirectory, "todolist.db");
|
||||
appSettings.WebServer.ConnectionString = $"Data Source={dbPath}";
|
||||
var localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
||||
var dbDir = Path.Combine(localAppData, "Hua.Todo");
|
||||
if (!Directory.Exists(dbDir))
|
||||
{
|
||||
Directory.CreateDirectory(dbDir);
|
||||
}
|
||||
var dbPath = Path.Combine(dbDir, "Hua.Todo.db");
|
||||
appSettings.WebServer.ConnectionString = $"Data Source={dbPath};Cache=Shared";
|
||||
}
|
||||
|
||||
builder.Services.AddSingleton(appSettings);
|
||||
@@ -63,8 +69,18 @@ public static class MauiProgram
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
_ = Task.Run(() => InitializeDatabase(app.Services, connectionString));
|
||||
_ = Task.Run(() => StartWebServer(app.Services));
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
InitializeDatabase(app.Services, connectionString);
|
||||
await StartWebServer(app.Services);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine($"App initialization failed: {ex}");
|
||||
}
|
||||
});
|
||||
|
||||
return app;
|
||||
}
|
||||
@@ -117,6 +133,8 @@ public static class MauiProgram
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure WAL mode to avoid locking issues
|
||||
dbContext.Database.ExecuteSqlRaw("PRAGMA journal_mode=WAL;");
|
||||
dbContext.Database.Migrate();
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -134,12 +152,12 @@ public static class MauiProgram
|
||||
}
|
||||
}
|
||||
|
||||
private static void StartWebServer(IServiceProvider services)
|
||||
private static async Task StartWebServer(IServiceProvider services)
|
||||
{
|
||||
try
|
||||
{
|
||||
var webServer = services.GetRequiredService<IEmbeddedWebServerService>();
|
||||
_ = webServer.StartAsync();
|
||||
await webServer.StartAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace TodoList.Maui.Models;
|
||||
namespace Hua.Todo.Maui.Models;
|
||||
|
||||
public class AppSettings
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace TodoList.Maui.Models
|
||||
namespace Hua.Todo.Maui.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 热键配置模型类
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace TodoList.Maui.Models
|
||||
namespace Hua.Todo.Maui.Models
|
||||
{
|
||||
public class QuickEntryData
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace TodoList.Maui.Models
|
||||
namespace Hua.Todo.Maui.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// 待办事项模型类
|
||||
/// 代办模型类
|
||||
/// </summary>
|
||||
public class TodoItem
|
||||
{
|
||||
@@ -2,7 +2,7 @@ using Android.Content.Res;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
|
||||
namespace TodoList.Maui.Platforms.Android;
|
||||
namespace Hua.Todo.Maui.Platforms.Android;
|
||||
|
||||
public sealed class AndroidAssetFileProvider : IFileProvider
|
||||
{
|
||||
@@ -2,7 +2,7 @@ using Android.App;
|
||||
using Android.Content.PM;
|
||||
using Android.OS;
|
||||
|
||||
namespace TodoList.Maui;
|
||||
namespace Hua.Todo.Maui;
|
||||
|
||||
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
|
||||
public class MainActivity : MauiAppCompatActivity
|
||||
@@ -1,7 +1,7 @@
|
||||
using Android.App;
|
||||
using Android.Runtime;
|
||||
|
||||
namespace TodoList.Maui;
|
||||
namespace Hua.Todo.Maui;
|
||||
|
||||
[Application]
|
||||
public class MainApplication : MauiApplication
|
||||
@@ -3,11 +3,11 @@ using System.Net.Sockets;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using TodoList.Application.Interfaces;
|
||||
using TodoList.Application.Models;
|
||||
using TodoList.Maui.Models;
|
||||
using Hua.Todo.Application.Interfaces;
|
||||
using Hua.Todo.Application.Models;
|
||||
using Hua.Todo.Maui.Models;
|
||||
|
||||
namespace TodoList.Maui.Services;
|
||||
namespace Hua.Todo.Maui.Services;
|
||||
|
||||
public sealed class MobileEmbeddedWebServerService : IEmbeddedWebServerService
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using Foundation;
|
||||
|
||||
namespace TodoList.Maui;
|
||||
namespace Hua.Todo.Maui;
|
||||
|
||||
[Register("AppDelegate")]
|
||||
public class AppDelegate : MauiUIApplicationDelegate
|
||||
@@ -1,7 +1,7 @@
|
||||
using ObjCRuntime;
|
||||
using UIKit;
|
||||
|
||||
namespace TodoList.Maui;
|
||||
namespace Hua.Todo.Maui;
|
||||
|
||||
public class Program
|
||||
{
|
||||
@@ -1,8 +1,8 @@
|
||||
<maui:MauiWinUIApplication
|
||||
x:Class="TodoList.Maui.WinUI.App"
|
||||
x:Class="Hua.Todo.Maui.WinUI.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:maui="using:Microsoft.Maui"
|
||||
xmlns:local="using:TodoList.Maui.WinUI">
|
||||
xmlns:local="using:Hua.Todo.Maui.WinUI">
|
||||
|
||||
</maui:MauiWinUIApplication>
|
||||
@@ -3,7 +3,7 @@
|
||||
// To learn more about WinUI, the WinUI project structure,
|
||||
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||
|
||||
namespace TodoList.Maui.WinUI;
|
||||
namespace Hua.Todo.Maui.WinUI;
|
||||
|
||||
/// <summary>
|
||||
/// Provides application-specific behavior to supplement the default Application class.
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace TodoList.Maui.Platforms.Windows
|
||||
namespace Hua.Todo.Maui.Platforms.Windows
|
||||
{
|
||||
public class WindowsKeyboardHandler : IDisposable
|
||||
{
|
||||
@@ -4,7 +4,7 @@ using Microsoft.Maui.Controls;
|
||||
using Microsoft.UI.Windowing;
|
||||
using WinRT.Interop;
|
||||
|
||||
namespace TodoList.Maui.Platforms.Windows
|
||||
namespace Hua.Todo.Maui.Platforms.Windows
|
||||
{
|
||||
public class WindowsWindowService
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="TodoList.Maui.WinUI.app"/>
|
||||
<assemblyIdentity version="1.0.0.0" name="Hua.Todo.Maui.WinUI.app"/>
|
||||
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
@@ -1,6 +1,6 @@
|
||||
using Foundation;
|
||||
|
||||
namespace TodoList.Maui;
|
||||
namespace Hua.Todo.Maui;
|
||||
|
||||
[Register("AppDelegate")]
|
||||
public class AppDelegate : MauiUIApplicationDelegate
|
||||
@@ -1,7 +1,7 @@
|
||||
using ObjCRuntime;
|
||||
using UIKit;
|
||||
|
||||
namespace TodoList.Maui;
|
||||
namespace Hua.Todo.Maui;
|
||||
|
||||
public class Program
|
||||
{
|
||||
@@ -1,8 +1,8 @@
|
||||
# TodoList MAUI 跨平台快捷键功能
|
||||
# Hua.Todo MAUI 跨平台快捷键功能
|
||||
|
||||
## 功能概述
|
||||
|
||||
本项目实现了基于 MAUI + WebView 架构的跨平台待办事项管理应用,支持全局快捷键快速唤醒功能。
|
||||
本项目实现了基于 MAUI + WebView 架构的跨平台代办管理应用,支持全局快捷键快速唤醒功能。
|
||||
|
||||
## 支持的平台
|
||||
|
||||
@@ -25,14 +25,14 @@
|
||||
- 设置持久化保存
|
||||
|
||||
### 3. WebView 集成
|
||||
- 主界面嵌入 WebView,显示 TodoList Web 应用
|
||||
- 主界面嵌入 WebView,显示 Hua.Todo Web 应用
|
||||
- 快捷键按下时自动激活窗口并聚焦 WebView
|
||||
- 支持与本地 API 服务通信
|
||||
|
||||
## 项目结构
|
||||
|
||||
```
|
||||
TodoList.Maui/
|
||||
Hua.Todo.Maui/
|
||||
├── Models/
|
||||
│ └── HotKeyConfig.cs # 快捷键配置模型
|
||||
├── Services/
|
||||
@@ -58,21 +58,21 @@ TodoList.Maui/
|
||||
|
||||
#### Windows
|
||||
```bash
|
||||
cd TodoList.Maui
|
||||
cd Hua.Todo.Maui
|
||||
dotnet build -f net10.0-windows10.0.19041.0
|
||||
dotnet run -f net10.0-windows10.0.19041.0
|
||||
```
|
||||
|
||||
#### macOS
|
||||
```bash
|
||||
cd TodoList.Maui
|
||||
cd Hua.Todo.Maui
|
||||
dotnet build -f net10.0-maccatalyst
|
||||
dotnet run -f net10.0-maccatalyst
|
||||
```
|
||||
|
||||
#### Android
|
||||
```bash
|
||||
cd TodoList.Maui
|
||||
cd Hua.Todo.Maui
|
||||
dotnet build -f net10.0-android
|
||||
dotnet run -f net10.0-android
|
||||
```
|
||||
@@ -134,7 +134,7 @@ dotnet run -f net10.0-android
|
||||
1. **macOS 权限**: 首次运行时需要在系统设置中授予辅助功能权限
|
||||
2. **Windows UAC**: 某些情况下可能需要管理员权限
|
||||
3. **移动端限制**: 移动端不支持真正的全局快捷键,使用通知快捷方式替代
|
||||
4. **WebView**: 确保 TodoList.Api 服务在 `http://localhost:5173` 运行
|
||||
4. **WebView**: 确保 Hua.Todo.Api 服务在 `http://localhost:5173` 运行
|
||||
|
||||
## 后续计划
|
||||
|
||||
@@ -146,4 +146,4 @@ dotnet run -f net10.0-android
|
||||
|
||||
## 许可证
|
||||
|
||||
MIT License
|
||||
AGPL-3.0 License ([English](file:///d:/Proj/Hua.Todo/LICENSE) | [中文](file:///d:/Proj/Hua.Todo/LICENSE.zh-CN))
|
||||
|
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 228 B |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 90 KiB |
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@@ -2,7 +2,7 @@ using Microsoft.Maui.ApplicationModel;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
namespace TodoList.Maui.Services;
|
||||
namespace Hua.Todo.Maui.Services;
|
||||
|
||||
public static class AppMetadata
|
||||
{
|
||||
@@ -6,12 +6,12 @@ using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using System.Text.Json;
|
||||
using TodoList.Application;
|
||||
using TodoList.Application.DynamicApi;
|
||||
using TodoList.Maui.Models;
|
||||
using AppSettings = TodoList.Maui.Models.AppSettings;
|
||||
using Hua.Todo.Application;
|
||||
using Hua.Todo.Application.DynamicApi;
|
||||
using Hua.Todo.Maui.Models;
|
||||
using AppSettings = Hua.Todo.Maui.Models.AppSettings;
|
||||
|
||||
namespace TodoList.Maui.Services;
|
||||
namespace Hua.Todo.Maui.Services;
|
||||
|
||||
public class EmbeddedWebServerService : IEmbeddedWebServerService
|
||||
{
|
||||
@@ -30,12 +30,12 @@ public class EmbeddedWebServerService : IEmbeddedWebServerService
|
||||
{
|
||||
if (_webApp != null) return;
|
||||
|
||||
var builder = WebApplication.CreateSlimBuilder();
|
||||
var builder = WebApplication.CreateBuilder();
|
||||
|
||||
builder.WebHost.UseUrls(_appSettings.WebServer.HostUrl);
|
||||
|
||||
|
||||
builder.Services.AddControllers()
|
||||
.AddApplicationPart(typeof(Hua.Todo.Application.ServiceCollectionExtensions).Assembly)
|
||||
.AddJsonOptions(options =>
|
||||
{
|
||||
options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase;
|
||||
@@ -1,6 +1,6 @@
|
||||
using TodoList.Maui.Services.Platforms;
|
||||
using Hua.Todo.Maui.Services.Platforms;
|
||||
|
||||
namespace TodoList.Maui.Services
|
||||
namespace Hua.Todo.Maui.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 全局热键服务工厂类,根据平台创建相应的热键服务实例
|
||||
@@ -1,8 +1,8 @@
|
||||
using Microsoft.Maui.Storage;
|
||||
using System.Text.Json;
|
||||
using TodoList.Maui.Models;
|
||||
using Hua.Todo.Maui.Models;
|
||||
|
||||
namespace TodoList.Maui.Services
|
||||
namespace Hua.Todo.Maui.Services
|
||||
{
|
||||
public interface IHotKeySettingsService
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TodoList.Maui.Services;
|
||||
namespace Hua.Todo.Maui.Services;
|
||||
|
||||
public interface IEmbeddedWebServerService
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TodoList.Maui.Services
|
||||
namespace Hua.Todo.Maui.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// 全局热键服务接口,定义跨平台热键功能
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TodoList.Maui.Services
|
||||
namespace Hua.Todo.Maui.Services
|
||||
{
|
||||
public interface ISystemTrayService
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace TodoList.Maui.Services;
|
||||
namespace Hua.Todo.Maui.Services;
|
||||
|
||||
public sealed class NoopEmbeddedWebServerService : IEmbeddedWebServerService
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using AppKit;
|
||||
using Foundation;
|
||||
|
||||
namespace TodoList.Maui.Services.Platforms
|
||||
namespace Hua.Todo.Maui.Services.Platforms
|
||||
{
|
||||
/// <summary>
|
||||
/// macOS 平台全局热键服务实现类
|
||||