Browse Source

sync...

master
eduveks 4 years ago
parent
commit
af7303e5d5
23 changed files with 182 additions and 2 deletions
  1. BIN
      dbs/social_interno.mv.db
  2. +15
    -0
      server/services/_openapi.json
  3. +12
    -0
      server/services/public/communities/image.get.js
  4. +8
    -0
      server/services/public/info/get.in.json
  5. +1
    -1
      server/services/public/info/get.js
  6. +23
    -0
      server/services/public/info/get.out.200.json
  7. +28
    -0
      server/services/public/register/post.in.json
  8. +11
    -0
      server/services/public/register/post.out.200.json
  9. +15
    -0
      server/services/public/register/post.out.409.json
  10. +30
    -0
      server/setup/_schema-form-2-comunidade.js
  11. BIN
      storage/database/comunidade/imagem/Photo1-PuMrkkQV.jpg
  12. BIN
      storage/database/comunidade/imagem/Photo1-PuMrkkQV___form.jpg
  13. BIN
      storage/database/comunidade/imagem/Photo1-PuMrkkQV___search.jpg
  14. BIN
      storage/database/comunidade/imagem/Photo2-kgp3GQqL.jpg
  15. BIN
      storage/database/comunidade/imagem/Photo2-kgp3GQqL___form.jpg
  16. BIN
      storage/database/comunidade/imagem/Photo2-kgp3GQqL___search.jpg
  17. BIN
      storage/database/comunidade/imagem/Photo3-MuqNBRwk.jpg
  18. BIN
      storage/database/comunidade/imagem/Photo3-MuqNBRwk___form.jpg
  19. BIN
      storage/database/comunidade/imagem/Photo3-MuqNBRwk___search.jpg
  20. +15
    -0
      website/src/pages/Communities/Item/index.js
  21. +0
    -0
      website/src/pages/Communities/Item/index.less
  22. +5
    -1
      website/src/pages/Communities/index.js
  23. +19
    -0
      website/src/pages/Communities/index.less

BIN
dbs/social_interno.mv.db View File


+ 15
- 0
server/services/_openapi.json View File

@ -0,0 +1,15 @@
{
"info": {
"title": "Aplicação Social Interna",
"description": "REST API da Minha Aplicação.",
"version": "1.0"
},
"components": {
"securitySchemes": {
"BearerAuth": {
"type": "http",
"scheme": "bearer"
}
}
}
}

+ 12
- 0
server/services/public/communities/image.get.js View File

@ -0,0 +1,12 @@
const dbComunidade = _db.queryFirst(`
SELECT imagem FROM comunidade WHERE uid = ?
`, _req.getString("uid"))
_header.contentTypeJPG()
_header.noCache()
if (dbComunidade != null && dbComunidade.getString("imagem") != '') {
const storageImage = _storage.database("comunidade", "imagem", dbComunidade.getString("imagem"))
_out.copy(storageImage.inputStream())
}

+ 8
- 0
server/services/public/info/get.in.json View File

@ -0,0 +1,8 @@
{
"summary": "Infomrações do Utilizador",
"description": "Obtém as informaçnoes do utilizador logado.",
"type": "object",
"properties": {
},
"required": [ ]
}

+ 1
- 1
server/services/public/info/get.js View File

@ -10,5 +10,5 @@ _out.json(
.set("name", dbPessoa.getString('nome')) .set("name", dbPessoa.getString('nome'))
.set("surname", dbPessoa.getString('apelido')) .set("surname", dbPessoa.getString('apelido'))
.set("email", dbPessoa.getString('email')) .set("email", dbPessoa.getString('email'))
.set("cidade", dbPessoa.getString('cidade'))
.set("city", dbPessoa.getString('cidade'))
) )

+ 23
- 0
server/services/public/info/get.out.200.json View File

@ -0,0 +1,23 @@
{
"type": "object",
"properties": {
"name": {
"type": "string-not-empty"
},
"surname": {
"type": "string-not-empty"
},
"email": {
"type": "string-not-empty"
},
"city": {
"type": "string-not-empty"
}
},
"required": [
"name",
"surname",
"email",
"city"
]
}

+ 28
- 0
server/services/public/register/post.in.json View File

@ -0,0 +1,28 @@
{
"summary": "Registo do Utilizador",
"description": "Permite registar uma nova conta com o utilizador associado.",
"type": "object",
"properties": {
"name": {
"type": "string-not-empty"
},
"surname": {
"type": "string-not-empty"
},
"city_uid": {
"type": "uid"
},
"email": {
"type": "string-not-empty"
},
"username": {
"type": "string-not-empty"
},
"password": {
"type": "string-not-empty"
}
},
"required": [
"name", "surname", "city_uid", "email", "username", "password"
]
}

+ 11
- 0
server/services/public/register/post.out.200.json View File

@ -0,0 +1,11 @@
{
"type": "object",
"properties": {
"result": {
"type": "boolean"
}
},
"required": [
"result"
]
}

+ 15
- 0
server/services/public/register/post.out.409.json View File

@ -0,0 +1,15 @@
{
"type": "object",
"properties": {
"result": {
"type": "boolean"
},
"error": {
"type": "string-not-empty"
}
},
"required": [
"result",
"error"
]
}

+ 30
- 0
server/setup/_schema-form-2-comunidade.js View File

@ -25,6 +25,36 @@ _form.createIfNotExists(
.set("show_id", true) .set("show_id", true)
.set("uid", "8527bd55-f919-4376-a263-ee3b86ec11a4") .set("uid", "8527bd55-f919-4376-a263-ee3b86ec11a4")
) )
_form.createComponentIfNotExists(
"8527bd55-f919-4376-a263-ee3b86ec11a4",
_val.init()
.set("colspan", 0)
.set("displayname", "Imagem")
.set("firebase", "")
.set("group_id", 0)
.set("height", 0)
.set("max", 0)
.set("min", 0)
.set("name", "imagem")
.set("notnull", false)
.set("primarykey", false)
.set("properties", "{}")
.set("rowspan", 0)
.set("tdheight", 0)
.set("tdwidth", 0)
.set("type", "image")
.set("uid", "09819ec4-00bd-478f-976b-e1ba40e1470e")
.set("user_id", 0)
.set("whenedit", true)
.set("whenexport", true)
.set("whenfilter", true)
.set("whennew", true)
.set("whenresult", true)
.set("whenview", true)
.set("width", 0)
.set("x", 1)
.set("y", 2)
)
_form.createComponentIfNotExists( _form.createComponentIfNotExists(
"8527bd55-f919-4376-a263-ee3b86ec11a4", "8527bd55-f919-4376-a263-ee3b86ec11a4",
_val.init() _val.init()


BIN
storage/database/comunidade/imagem/Photo1-PuMrkkQV.jpg View File

Before After
Width: 1920  |  Height: 1080  |  Size: 281 KiB

BIN
storage/database/comunidade/imagem/Photo1-PuMrkkQV___form.jpg View File

Before After
Width: 400  |  Height: 225  |  Size: 9.2 KiB

BIN
storage/database/comunidade/imagem/Photo1-PuMrkkQV___search.jpg View File

Before After
Width: 200  |  Height: 112  |  Size: 3.2 KiB

BIN
storage/database/comunidade/imagem/Photo2-kgp3GQqL.jpg View File

Before After
Width: 1920  |  Height: 1080  |  Size: 709 KiB

BIN
storage/database/comunidade/imagem/Photo2-kgp3GQqL___form.jpg View File

Before After
Width: 400  |  Height: 225  |  Size: 25 KiB

BIN
storage/database/comunidade/imagem/Photo2-kgp3GQqL___search.jpg View File

Before After
Width: 200  |  Height: 112  |  Size: 7.1 KiB

BIN
storage/database/comunidade/imagem/Photo3-MuqNBRwk.jpg View File

Before After
Width: 1920  |  Height: 1080  |  Size: 789 KiB

BIN
storage/database/comunidade/imagem/Photo3-MuqNBRwk___form.jpg View File

Before After
Width: 400  |  Height: 225  |  Size: 27 KiB

BIN
storage/database/comunidade/imagem/Photo3-MuqNBRwk___search.jpg View File

Before After
Width: 200  |  Height: 112  |  Size: 7.7 KiB

+ 15
- 0
website/src/pages/Communities/Item/index.js View File

@ -0,0 +1,15 @@
import React, { useState, useEffect } from 'react';
import _service from '@netuno/service-client';
export default ({ data })=> {
useEffect(() => {
}, []);
const servicesPrefix = _service.config().prefix;
return (
<li style={ { backgroundImage: `url(${servicesPrefix}public/communities/image?uid=${data.uid})` } }>
<h1>{data.name}</h1>
</li>
);
};

+ 0
- 0
website/src/pages/Communities/Item/index.less View File


+ 5
- 1
website/src/pages/Communities/index.js View File

@ -6,6 +6,10 @@ import _auth from '@netuno/auth-client';
import _service from '@netuno/service-client'; import _service from '@netuno/service-client';
import Item from './Item';
import './index.less';
export default ()=> { export default ()=> {
if (!_auth.isLogged()) { if (!_auth.isLogged()) {
return <Redirect to="/login" />; return <Redirect to="/login" />;
@ -28,7 +32,7 @@ export default ()=> {
<div class="communities"> <div class="communities">
<ul class="communities__list"> <ul class="communities__list">
{ data.map((community)=> ( { data.map((community)=> (
<li>{community.name}</li>
<Item data={ community } />
))} ))}
</ul> </ul>
</div> </div>


+ 19
- 0
website/src/pages/Communities/index.less View File

@ -0,0 +1,19 @@
.communities {
&__list {
list-style: none;
padding: 0;
margin: 0;
> li {
background-size: cover;
background-repeat: no-repeat;
background-position: 50% 50%;
height: 200px;
> h1 {
background-color: rgba(0, 0, 0, 0.75);
color: #ffffff;
padding: 10px;
}
}
}
}

Loading…
Cancel
Save